Skip to content

Commit 9710d9a

Browse files
committed
Add Pulse authorization
1 parent 08c8343 commit 9710d9a

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

app/Providers/AuthServiceProvider.php

+4
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
use App\Policies\UserPolicy;
1414
use Illuminate\Foundation\Support\Providers\AuthServiceProvider as ServiceProvider;
1515
use Illuminate\Notifications\DatabaseNotification as Notification;
16+
use Illuminate\Support\Facades\Gate;
1617

1718
class AuthServiceProvider extends ServiceProvider
1819
{
@@ -26,5 +27,8 @@ class AuthServiceProvider extends ServiceProvider
2627

2728
public function boot(): void
2829
{
30+
Gate::define('viewPulse', function (User $user) {
31+
return $user->isAdmin();
32+
});
2933
}
3034
}

0 commit comments

Comments
 (0)