generated from spatie/package-skeleton-laravel
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
46183f5
commit f3dc4f7
Showing
5 changed files
with
41 additions
and
0 deletions.
There are no files selected for viewing
37 changes: 37 additions & 0 deletions
37
stubs/invitation-only-super-admin/app/Providers/AppServiceProvider.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
<?php | ||
|
||
namespace App\Providers; | ||
|
||
use App\Models\SuperAdmin; | ||
use App\Models\User; | ||
use Illuminate\Support\Facades\Gate; | ||
use Illuminate\Support\ServiceProvider; | ||
|
||
class AppServiceProvider extends ServiceProvider | ||
{ | ||
/** | ||
* Register any application services. | ||
*/ | ||
public function register(): void | ||
{ | ||
// | ||
} | ||
|
||
/** | ||
* Bootstrap any application services. | ||
*/ | ||
public function boot(): void | ||
{ | ||
Gate::before(function (SuperAdmin|User $user, string $ability) { | ||
if ($user instanceof SuperAdmin) { | ||
return true; | ||
} | ||
}); | ||
|
||
Gate::after(function (SuperAdmin|User $user, string $ability, bool|null $result, mixed $arguments) { | ||
if ($user instanceof SuperAdmin) { | ||
return true; | ||
} | ||
}); | ||
} | ||
} |
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.