feat: add routes, lang, tests, stubs, docs, and docker configurations
This commit is contained in:
@@ -0,0 +1,20 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Support\Facades\Broadcast;
|
||||
|
||||
Broadcast::channel('App.Models.User.{id}', function ($user, $id) {
|
||||
return (int) $user->id === (int) $id;
|
||||
});
|
||||
|
||||
// 🛡️ ROLE BASED CHANNELS (Dynamic)
|
||||
Broadcast::channel('roles.{roleName}', function ($user, $roleName) {
|
||||
if ($user->hasAnyRole(['Developer', 'Administrator'])) {
|
||||
return true;
|
||||
}
|
||||
|
||||
return $user->hasRole($roleName);
|
||||
});
|
||||
|
||||
Broadcast::channel('admin.monitoring', function ($user) {
|
||||
return $user->can('view health and logs');
|
||||
});
|
||||
Reference in New Issue
Block a user