spigo / lorem
Simple text and images for Laravel
Installs: 31
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 1
Forks: 0
Open Issues: 0
Type:helper
This package is auto-updated.
Last update: 2024-09-21 02:53:12 UTC
README
Lorem ipsum generator in PHP
Install
composer require spigo/lorem
After you have installed open your Laravel config file config/app.php and add the following lines. In the $providers array add the service providers for this package.
Spigo\Lorem\LoremServiceProvider::class
#Usage Access Lorem by using the global helper lorem()
HTML
<body> <div class="content"> <!-- Returns one paragraph of lorem ipsum --> {!! lorem()->paragraph()->getHtml() !!} </div> </body>
<body> <div class="content"> <!-- Returns 17 paragraphs of lorem ipsum --> {!! lorem()->paragraphs(17)->getHtml() !!} </div> </body>
Image
<body> <div class="content"> <!-- Returns an img tag of a image (1024x1024) --> {!! lorem()->image()->getHtml() !!} </div> </body>
<body> <div class="content"> <!-- Returns an img tag of a image (1000x600) with class --> {!! lorem()->image(1000, 600, ['class' => 'img-responsive']) !!} </div> </body>
<body> <!-- Returns an url of a image (200x200) --> <div style="background-image: url({!! lorem()->imageUrl(200,200)->get() !!})"></div> </div> </body>
Text
<body> <!-- Returns one paragraph of lorem ipsum in pure text --> <textarea>{!! lorem()->paragraph()->get() !!}</textarea> </body>
<body> <!-- Returns 17 paragraphs of lorem ipsum in pure text --> <textarea>{!! lorem()->paragraphs(17)->get() !!}</textarea> </body>