Skip to content

Tag: laravel

Call to a member function lastPage() on int using laravel 6

i am starting to create an ads site, i display 36 products images in a blade index with success ,but when i try add pagination i get this error Call to a member function lastPage() on int . AnnoncesController.php landing-page.blade.php Answer You are calling $paginator->lastPage(); and $paginator is an int…

How to create pagination using Laravel 6?

i am starting to create an ads site, i display 36 products in a blade index with success, my problem is that 36 of the products display, the leftovers do not display, and i don’t know how to display the 2nd page and 3rd and so on depending on the number of pages to display the other products. AnnoncesCo…

Algolia not importing my records laravel scout

I am using laravel scout to implement my text search. I followed all the configuration instructions and imported the records. When I do that i get this success message Imported [AppThread] models up to ID: 8 but in algolia I can’t see my records for the given index, it keeps saying I have 0 records. I a…

How to pass arguments to custom composer script

In my Laravel project, I want to run phpunit for a single file, like this one: Here is my composer setup: However, I’m running into this error: www@287dd7480e22:/var/www$ composer run-script test tests/Unit/Services/OrderServiceTest.php php artisan config:cache –env=testing ‘tests/Unit/Servi…

using Laravel 7 Api routes

I’m trying to use simple laravel api for getting and sending requests, after define this api routes in api.php: and creating AuthController in app/http/controller/Api/v1 directory: i get 404 error on this link: how can i resolve this problem? Answer Routes in api.php are automatically prefixed with /api…