megahunt.test/app/Http/Requests/AuthorizedRequest.php

17 lines
353 B
PHP
Raw Normal View History

<?php
namespace App\Http\Requests;
class AuthorizedRequest extends RestRequest
{
/**
* Determine if the user is authorized to make this request.
*/
public function authorize(): bool
{
2024-08-30 10:24:26 +02:00
return cache()->remember('isSessionAuthorized'.session()->id(), 5, function () {
2024-08-30 10:18:50 +02:00
return auth()->check();
});
}
}