Code Monkey home page Code Monkey logo

fact's Introduction

Fact Generator

Fact generator is a simple laravel package which generate fact image. You only need to define your desired image, logo and text to generate sample fact image. It support English and Persian.

Install

1- Install the package with composer

composer require --dev ghorbannezhad/fact

2- Publish config file

php artisan vendor:publish --provider="Ghorbannezhad\Fact\FactServiceProvider"

Usage

1- Add service provider to config/app.php

'providers' => [
    ...
    Ghorbannezhad\Fact\FactServiceProvider::class,
]

2- Call fact facade in controller

    $image = public_path('/address/to/image.jpg');
    $text= 'Lorem ipsum';
    $fact = FactFacade::create($image,$text);

3- Set language and font in config file

return [
    'logo'=>$logo,
    'style'=>[
        'margin_top'=>10,        //in percent
        'margin_left'=>10,      //in percent
        'margin_bottom'=>10,   //in percent
        'margin_right'=>10,   //in percent
        'font_size'=>24,
        'line_height'=>50,
        'logo_from_bottom'=> 10,  //in percent
        'font'=>$font,
        'text_align'=>'center' //supported: center|right|left
    ],
    'lang'=>'fa', //supported: fa | en
    'save_path'=>$save_path,

];

Contributers

License

FactGenerator is licensed under the MIT License - see the LICENSE file for details

fact's People

Contributors

ghorbannezhad avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.