I’m getting response from an api in Laravel using HTTP client. And It takes some time.I just want to calculate that how much percentage of data is fetched from api. And when progressbar of 100% complete it means data is completely fetched and ready to show. So any solution for this.
2
Answers
if you are that flexible then you can do it this way 😉
You can use queue job with livewire and tailwind css to achieve this goal.
composer require livewire/livewire
.php artisan make:livewire YourClassWire
to create livwire class, and you can find it under /App/Http/Livewire.now in your livewire view you can create your progress bar
I hope this guide you to what you want..success
You could do some logic like:
or if you need to calculate average or something like that you can go
Note: If there are a lot of data in the JSON response, queues would be a good solution for it 🙂
Queues