1. Go to this page and download the library: Download aldeebhasan/lottie-laravel library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
aldeebhasan / lottie-laravel example snippets
<x-lottie
class="class-1 class-2"
style="color:red; background-color:blue;"
path="path to lottie file (.json)"
animType="animation type (ex: svg)"
loop="true|false"
autoplay="true|false"
:data="array of the lottie file content"
>
</x-lottie>
$content = Lottie::loadUrl("https://example.json")
->replaceColor("#000","#0f0f0f") // color with color
->replaceColor(["#000","#00f"],"#fff") // color list with color
->replaceColor(["#000","#00f"],["#fff","#ff0"]); // color list with color list
$content = Lottie::loadUrl("https://example.json")
->replaceColor("rgb(0,0,0)",'rgba(255,255,0)'); // color with color