quick code clean ups

This commit is contained in:
2024-03-27 01:54:56 +05:00
parent 22ccedba92
commit 0440edfb88
3 changed files with 115 additions and 64 deletions

View File

@@ -0,0 +1,33 @@
<?php
namespace App\Repos\System\Nova;
use Closure;
use Illuminate\Support\Facades\Gate;
class NovaPermissionRepo
{
/**
* Check if user is me
*/
public static function isMe(): Closure
{
return fn () => Gate::allows('isMe', auth()->user());
}
/**
* Check if user is admin
*/
public static function isSuperAdmin(): Closure
{
return fn () => Gate::allows('isSuperAdmin', auth()->user());
}
/**
* Check if user is admin
*/
public static function isAdmin(): Closure
{
return fn () => Gate::allows('isAdmin', auth()->user());
}
}