Download the PHP package aldeebhasan/lottie-laravel without Composer
On this page you can find all versions of the php package aldeebhasan/lottie-laravel. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download aldeebhasan/lottie-laravel
More information about aldeebhasan/lottie-laravel
Files in aldeebhasan/lottie-laravel
Package lottie-laravel
Short Description This package will allow you to manage and preview lottiefiles in your laravel project
License MIT
Informations about the package lottie-laravel
Laravel Lottie Library
A php package allow you to load lottie files to your blade directly or after making some updates.
Requirements
- PHP 8.1+
- Laravel 10.x, 11.x or 12.x
Installation
Install using composer:
A new cache capabilities added to the package, you can enable it by using the following keys to your env file:
you can publish the config file using the following command:
The lottie-web player (v5.13.0) is bundled with the package and served from
/lottie-laravel/lottie.min.js, so no CDN or asset publishing is needed.
Basic Usage
Lottie file component
You can use the lottie file component directly within your blade as following
All the attributes are optional. Anyway, either
path or animationData should be specified in order to
display the lottie.
Lottie files manager
The package also provide a manager to manage the lottie files and make updates over them(like changing the colors)
You can load the lottie file from remote url or pass the file content directly. Check the following
After loading the lottie file to the manager you can change the colors using one of the following
The function replaceColor also accept rgb and rgba color encoding:
To retrieve the updated lottie data you can use our export function:
Finally, thanks for the lottie-web package author, without their lottie player, we were not able to complete this work.
You can directly get an instance from the lottie manager using our helper function lottie()
Direct Rendering
now you can render the desired lottie file directly in your blade files. Only you need to provide the lottie file data or path, and you will get your view back.
Accessibility
Use the alt attribute to describe the animation for screen reader users.
The container is then exposed as an image (role="img") with your text as its aria-label:
When alt is omitted, the animation is treated as decorative and hidden from assistive
technologies (aria-hidden="true"). The loading indicator is always hidden from them.
Reduced motion
Animations respect the user's prefers-reduced-motion setting: when it is enabled, autoplay is
disabled and the animation stays on its first frame (the loading indicator stops spinning too).
If the setting changes while the page is open, the animation pauses or resumes accordingly.
Examples
-
Loading lottie file directly in the blade:
- Loading lottie file using the manager and pass it to the lottie component:
| 
License
Laravel Lottie Library package is licensed under The MIT License (MIT).
Security contact information
To report a security vulnerability, contact directly to the developer contact email Here.
All versions of lottie-laravel with dependencies
ext-json Version *
guzzlehttp/guzzle Version ^7.5
illuminate/cache Version ^10.0|^11.0|^12.0
illuminate/http Version ^10.0|^11.0|^12.0
illuminate/support Version ^10.0|^11.0|^12.0
illuminate/view Version ^10.0|^11.0|^12.0