Skip to content

Commit

Permalink
feat: added laravel pulse (#757)
Browse files Browse the repository at this point in the history
  • Loading branch information
Kyrch authored Nov 9, 2024
1 parent 7c23f5f commit 55e37e1
Show file tree
Hide file tree
Showing 21 changed files with 675 additions and 617 deletions.
6 changes: 0 additions & 6 deletions .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -271,12 +271,6 @@ SESSION_STORE=null
SESSION_DOMAIN=null
SESSION_SECURE_COOKIE=

# telescope
TELESCOPE_DOMAIN=null
TELESCOPE_PATH=telescope
TELESCOPE_DRIVER=database
TELESCOPE_ENABLED=true

# validation
MODERATION_SERVICE=none

Expand Down
6 changes: 0 additions & 6 deletions .env.example-sail
Original file line number Diff line number Diff line change
Expand Up @@ -269,12 +269,6 @@ SESSION_STORE=null
SESSION_DOMAIN=null
SESSION_SECURE_COOKIE=

# telescope
TELESCOPE_DOMAIN=null
TELESCOPE_PATH=telescope
TELESCOPE_DRIVER=database
TELESCOPE_ENABLED=true

# validation
MODERATION_SERVICE=none

Expand Down
9 changes: 0 additions & 9 deletions app/Console/Kernel.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
use Illuminate\Queue\Console\PruneFailedJobsCommand;
use Laravel\Horizon\Console\SnapshotCommand;
use Laravel\Sanctum\Console\Commands\PruneExpired;
use Laravel\Telescope\Console\PruneCommand as PruneTelescopeEntriesCommand;
use Propaganistas\LaravelDisposableEmail\Console\UpdateDisposableDomainsCommand;

/**
Expand Down Expand Up @@ -110,14 +109,6 @@ protected function schedule(Schedule $schedule): void
->storeOutput()
->hourly();

if (config('telescope.enabled') === true) {
$schedule->command(PruneTelescopeEntriesCommand::class)
->withoutOverlapping()
->runInBackground()
->storeOutput()
->daily();
}

$schedule->command(SnapshotCommand::class)
->withoutOverlapping()
->runInBackground()
Expand Down
2 changes: 1 addition & 1 deletion app/Enums/Auth/SpecialPermission.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ enum SpecialPermission: string

case VIEW_HORIZON = 'view horizon';

case VIEW_TELESCOPE = 'view telescope';
case VIEW_PULSE = 'view pulse';

case REVALIDATE_PAGES = 'revalidate pages';
}
28 changes: 28 additions & 0 deletions app/Providers/PulseServiceProvider.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
<?php

declare(strict_types=1);

namespace App\Providers;

use App\Enums\Auth\SpecialPermission;
use App\Models\Auth\User;
use Illuminate\Support\Facades\Gate;
use Laravel\Pulse\PulseServiceProvider as BasePulseServiceProvider;

/**
* Class PulseServiceProvider.
*/
class PulseServiceProvider extends BasePulseServiceProvider
{
/**
* Bootstrap any application services.
*
* @return void
*/
public function boot(): void
{
parent::boot();

Gate::define('viewPulse', fn (User $user) => $user->can(SpecialPermission::VIEW_PULSE->value));
}
}
78 changes: 0 additions & 78 deletions app/Providers/TelescopeServiceProvider.php

This file was deleted.

2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,9 @@
"laravel/framework": "^11.21",
"laravel/horizon": "^5.12",
"laravel/pennant": "^1.2",
"laravel/pulse": "^1.2",
"laravel/sanctum": "^4.0",
"laravel/scout": "^10.0",
"laravel/telescope": "^5.0",
"laravel/tinker": "^2.8",
"league/flysystem-aws-s3-v3": "^3.0",
"leandrocfe/filament-apex-charts": "^3.1",
Expand Down
Loading

0 comments on commit 55e37e1

Please sign in to comment.