Skip to content

Commit

Permalink
Moox Jobs and Horizon
Browse files Browse the repository at this point in the history
  • Loading branch information
adrolli committed Jan 26, 2024
1 parent 5e7b1e4 commit fddbf85
Show file tree
Hide file tree
Showing 25 changed files with 1,495 additions and 30 deletions.
4 changes: 3 additions & 1 deletion app/Console/Kernel.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,9 @@ class Kernel extends ConsoleKernel
*/
protected function schedule(Schedule $schedule): void
{
// $schedule->command('inspire')->hourly();
$schedule->command('backup-server:dispatch-backups')->everyMinute();
$schedule->command('backup-server:cleanup')->daily();
$schedule->command('backup-server:monitor')->daily();
}

/**
Expand Down
9 changes: 7 additions & 2 deletions app/Providers/Filament/AdminPanelProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -55,10 +55,15 @@ public function panel(Panel $panel): Panel
Authenticate::class,
])
->plugins([
\Moox\BackupServerUi\BackupLogItemPlugin::make(),
\Moox\BackupServerUi\BackupPlugin::make(),
\Moox\BackupServerUi\DestinationPlugin::make(),
\Moox\BackupServerUi\SourcePlugin::make(),
\Moox\BackupServerUi\DestinationPlugin::make(),
\Moox\BackupServerUi\BackupLogItemPlugin::make(),

\Moox\Jobs\JobsPlugin::make(),
\Moox\Jobs\JobsFailedPlugin::make(),
\Moox\Jobs\JobsBatchesPlugin::make(),
\Moox\Jobs\JobsWaitingPlugin::make(),

]);
}
Expand Down
36 changes: 36 additions & 0 deletions app/Providers/HorizonServiceProvider.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
<?php

namespace App\Providers;

use Illuminate\Support\Facades\Gate;
use Laravel\Horizon\Horizon;
use Laravel\Horizon\HorizonApplicationServiceProvider;

class HorizonServiceProvider extends HorizonApplicationServiceProvider
{
/**
* Bootstrap any application services.
*/
public function boot(): void
{
parent::boot();

// Horizon::routeSmsNotificationsTo('15556667777');
// Horizon::routeMailNotificationsTo('[email protected]');
// Horizon::routeSlackNotificationsTo('slack-webhook-url', '#channel');
}

/**
* Register the Horizon gate.
*
* This gate determines who can access Horizon in non-local environments.
*/
protected function gate(): void
{
Gate::define('viewHorizon', function ($user) {
return in_array($user->email, [
//
]);
});
}
}
6 changes: 4 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,12 @@
"filament/filament": "^3.2",
"guzzlehttp/guzzle": "^7.2",
"laravel/framework": "^10.10",
"laravel/horizon": "^5.22",
"laravel/sanctum": "^3.3",
"laravel/tinker": "^2.8",
"spatie/laravel-backup-server": "^3.1",
"moox/backup-server-ui": "dev-main"
"moox/backup-server-ui": "dev-main",
"moox/jobs": "^2.0",
"spatie/laravel-backup-server": "^3.1"
},
"require-dev": {
"fakerphp/faker": "^1.9.1",
Expand Down
220 changes: 219 additions & 1 deletion composer.lock

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

1 change: 1 addition & 0 deletions config/app.php
Original file line number Diff line number Diff line change
Expand Up @@ -167,6 +167,7 @@
App\Providers\AuthServiceProvider::class,
// App\Providers\BroadcastServiceProvider::class,
App\Providers\EventServiceProvider::class,
App\Providers\HorizonServiceProvider::class,
App\Providers\Filament\AdminPanelProvider::class,
App\Providers\RouteServiceProvider::class,
])->toArray(),
Expand Down
6 changes: 3 additions & 3 deletions config/backup-server.php
Original file line number Diff line number Diff line change
Expand Up @@ -46,11 +46,11 @@
'notifiable' => \Spatie\BackupServer\Notifications\Notifiable::class,

'mail' => [
'to' => '[email protected]',
'to' => '[email protected]',

'from' => [
'address' => env('MAIL_FROM_ADDRESS', '[email protected]'),
'name' => env('MAIL_FROM_NAME', 'Example'),
'address' => env('MAIL_FROM_ADDRESS', '[email protected]'),
'name' => env('MAIL_FROM_NAME', 'Moox Backup Server'),
],
],

Expand Down
Loading

0 comments on commit fddbf85

Please sign in to comment.