yaroslawww / laravel-lorem-image
Generates a configured preview image.
2.0.0
2022-10-05 07:08 UTC
Requires
- php: ^8.1
- illuminate/support: ^9.0
Requires (Dev)
- friendsofphp/php-cs-fixer: ^3.11
- orchestra/testbench: ^7.7
- phpunit/phpunit: ^9.5
- psalm/plugin-laravel: ^2.0
- vimeo/psalm: ^4.27
This package is auto-updated.
Last update: 2024-10-05 11:45:06 UTC
README
Generates a configured preview image.
Installation
Install the package via composer:
composer require yaroslawww/laravel-lorem-image
# Or only for development purposes
composer require yaroslawww/laravel-lorem-image --dev
Optionally you can publish the config file with:
php artisan vendor:publish --provider="Limsum\ServiceProvider" --tag="config"
If you need to use color-block
driver, then please add routes to web.php
\Limsum\Facades\Limsum::routes();
Usage
\Limsum::url();
// or
\Limsum\Facades\Limsum::size(274, 200)->svg()->url();
\Limsum\Facades\Limsum::driver('color-block')->size(274, 200)->svg()->url();
\Limsum\Facades\Limsum::url([
'width' => 274,
'height' => 200
]);
\Limsum\Facades\Limsum::url('thumbnail');
\Limsum\Facades\Limsum::driver('lorem-picsum')->size(274, 200)->random()->url()
Example image for development purpose with lazy loading. (Lazy loading not includes in package)
<img class="lazy" src="{{ \Limsum\Facades\Limsum::size(274, 200)->svg()->url() }}" data-src="{{ \Limsum\Facades\Limsum::driver('lorem-picsum')->size(274, 200)->random()->url() }}" >