cache
This commit is contained in:
parent
eec63fdc3b
commit
3651faeb4d
@ -4,6 +4,7 @@
|
||||
|
||||
use App\Models\Enums\UserRole;
|
||||
use Exception;
|
||||
use Illuminate\Support\Facades\Cache;
|
||||
|
||||
final readonly class WorklistFactory
|
||||
{
|
||||
@ -12,7 +13,8 @@
|
||||
*/
|
||||
public static function getLister(): IUserStudyLister
|
||||
{
|
||||
$role = auth()->user()->roles()->first()->name;
|
||||
// $role = auth()->user()->roles()->first()->name;
|
||||
$role = Cache::remember('user_role:'.auth()->id(), now()->addMinutes(5), fn () => auth()->user()->roles()->first()->name);
|
||||
|
||||
return match (UserRole::from($role)) {
|
||||
UserRole::Admin => new AdminWorklist,
|
||||
|
Loading…
Reference in New Issue
Block a user