Skip to content

Commit

Permalink
chore: set up Laravel Pulse
Browse files Browse the repository at this point in the history
  • Loading branch information
wescopeland committed Aug 31, 2024
1 parent d40aab6 commit 700d4b1
Show file tree
Hide file tree
Showing 8 changed files with 494 additions and 1 deletion.
6 changes: 6 additions & 0 deletions app/Providers/AppServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
use Illuminate\Support\Facades\Blade;
use Illuminate\Support\ServiceProvider;
use Illuminate\Support\Str;
use Laravel\Pulse\Facades\Pulse;
use Livewire\Livewire;

class AppServiceProvider extends ServiceProvider
Expand Down Expand Up @@ -61,6 +62,11 @@ public function boot(): void

Model::shouldBeStrict(!$this->app->isProduction());

Pulse::user(fn (User $user) => [
'name' => $user->User,
'avatar' => $user->avatarUrl,
]);

$this->app->booted(function () {
$schedule = $this->app->make(Schedule::class);
$schedule->command(LogUsersOnlineCount::class)->everyThirtyMinutes();
Expand Down
2 changes: 2 additions & 0 deletions app/Providers/AuthServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -88,5 +88,7 @@ public function boot(): void

Gate::define('viewLogViewer', fn (User $user) => $user->can('tool'));

Gate::define('viewPulse', fn (User $user) => $user->can('tool'));

}
}
1 change: 1 addition & 0 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
"laravel/horizon": "^5.10",
"laravel/octane": "^2.3",
"laravel/passport": "^12.0",
"laravel/pulse": "^1.2",
"laravel/scout": "^10.2",
"laravel/socialite": "^5.5",
"laravel/tinker": "^2.9",
Expand Down
144 changes: 143 additions & 1 deletion composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 700d4b1

Please sign in to comment.