I want to cache one route in Laravel project and clear it for every 5 minutes. I searched a bunch of articles but only found artisan route:cache command and I have no idea if it possible to configure caching time. So, this is my routes routes/web.php: And every time when user loads rating page the getLeaders() function initiates DB request
Tag: laravel
php artisan serve command display error message
I am using php 7.3.2 on window 7. When I try to run php artisan serve, it shows this error on the webpage: Whoops, looks like something went wrong. Is it related to the message that I received …
I want to convert pdf to text. but it gives me error. why spatie/pdf-to-text is showing error?
my code error message Fatal error: Uncaught SpatiePdfToTextExceptionsCouldNotExtractText: The command “”/usr/bin/pdftotext” simple.pdf -” failed. Exit Code: 1(General error) Working directory: C:xampphtdocspdf Output: ================ Error Output: ================ The system cannot find the path specified. in C:xampphtdocspdfvendorspatiepdf-to-textsrcPdf.php:73 Stack trace: #0 C:xampphtdocspdfvendorspatiepdf-to-textsrcPdf.php(84): SpatiePdfToTextPdf->text() #1 C:xampphtdocspdfindex.php(7): SpatiePdfToTextPdf::getText(‘simple.pdf’) #2 {main} thrown in C:xampphtdocspdfvendorspatiepdf-to-textsrcPdf.php on line 73 Answer pdftext is a .exe file located in your
PHP7/Laravel – Declaration of, Should be compatible with
Currently facing an issue with an old Laravel project I am trying to revive and update. The error we’re receiving is being thrown on line 11 inside of MessagesController like so: “…/app/Http/Controllers/Administrator/MessagesController.php:11” Messages Controller: Base Controller: Answer Your parent Controller has not included use IlluminateHttpRequest;. Secondly your parent getUserName method, has the request parameter set to nullable. So change your
Laravel get ID of newly created resource
So basically I am doing this: Laptop::create([ ‘user_id’ => 1, ‘name’ => $request->name, ‘brand’ => $request->brand, ‘SN’ => $request->SN, ‘price’ => $…
Laravel request url with parameter problem with GET Method
I have a route in api.php which look like this: Route::get(‘auth/logout/{token}’,’UserController.php’; I tested this API endpoint using Postman with these configurations: Method: GET Params: key = …
Laravel equivalent of ->fetch?
I am working on a website that uses PHP and SQL to connect to the database, I’m trying to replace all the SQL with Laravel Query Builder commands. I am running into a problem with the following code:…
How get bitfumes/laravel-multiauth to know my controllers?
I’m using bitfumes/laravel-multiauth Admin, I added my routes to the routes/admin.php but it shows me this error that it can’t find my contoller. Target class [BitfumesMultiauthHttpControllers…
How to use pluck to get specific data from other table in Laravel?
From SalesController, I want to get specific name from table Item and passed to HTML. My controller looks like public function index() { $items=Item::orderBy(‘name’,’ASC’)->get()->pluck(‘…
Using Barcode Number as Primary Key in Laravel
I have problem to define the barcode number as the primary key at Item table. Previously I use the usual ID as the primary key. Schema::create(‘items’, function (Blueprint $table) { $table->…