skip to Main Content

Track the last activity in laravel

In laravel auth middleware i create session variable and store the the last entering time like class Authenticate extends Middleware { public function handle($request, Closure $next, ...$guards) { if (auth()->check()) { session()->put('activity_time', now()->toDateTimeString()); } return parent::handle($request, $next, ...$guards); } protected…

VIEW QUESTION

Empty request parameters in Laravel 10

I have a strange problem with my project in Laravel 10. My $request comes empty in my controller. Controller public function postSettings(Request $request){ $user = $request->user(); $request = $request->validate([ 'scroll_lock' => 'boolean', 'test_mode' => 'boolean', ]); $settings = Settings::find($user->id) ?…

VIEW QUESTION

Laravel Class Intervention Image not found

I'm new to Laravel, I use Intervention Image on laravel 10.39.0, but it is getting error, Class "InterventionImageFacadesImage" not found This is the code. This is the code. <?php namespace AppHttpControllers; use IlluminateHttpRequest; use InterventionImageFacadesImage; class HomeController extends Controller {…

VIEW QUESTION

How can I shorten Laravel API response time?

I was pulling the data this way, but when I query with Postman, it takes too long to get the response. public function getAllItems(Request $request) { $type = $request->input('type'); $query = Item::query(); if ($type === 'series') { $query->where('is_series', true); }…

VIEW QUESTION
Back To Top
Search