Skip to content

Commit 5d27110

Browse files
committed
feat: add support for horizon
1 parent b1b645c commit 5d27110

9 files changed

Lines changed: 586 additions & 61 deletions

File tree

.env.example

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ SESSION_DOMAIN=null
3333

3434
BROADCAST_CONNECTION=log
3535
FILESYSTEM_DISK=local
36-
QUEUE_CONNECTION=sync
36+
QUEUE_CONNECTION=redis
3737

3838
CACHE_STORE=database
3939
# CACHE_PREFIX=

Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ USER root
66
# Install additional PHP extensions
77
RUN set -ex; \
88
install-php-extensions \
9+
redis \
910
sockets
1011

1112
# Drop back to our unprivileged user
@@ -49,6 +50,5 @@ RUN echo "$VERSION (${REVISION:0:7})" > /var/www/html/.version
4950

5051
COPY --from=assets --chown=www-data:www-data /build/public/build /var/www/html/public/build
5152

52-
ENV QUEUE_ENABLED=true
5353

5454
ENV PHP_PM_MAX_CHILDREN=64
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
<?php
2+
3+
declare(strict_types=1);
4+
5+
namespace App\Providers;
6+
7+
use App\Models\User;
8+
use Illuminate\Support\Facades\Gate;
9+
use Laravel\Horizon\HorizonApplicationServiceProvider;
10+
11+
class HorizonServiceProvider extends HorizonApplicationServiceProvider
12+
{
13+
/**
14+
* Bootstrap any application services.
15+
*/
16+
public function boot(): void
17+
{
18+
parent::boot();
19+
20+
// Horizon::routeSmsNotificationsTo('15556667777');
21+
// Horizon::routeMailNotificationsTo('example@example.com');
22+
// Horizon::routeSlackNotificationsTo('slack-webhook-url', '#channel');
23+
}
24+
25+
/**
26+
* Register the Horizon gate.
27+
*
28+
* This gate determines who can access Horizon in non-local environments.
29+
*/
30+
protected function gate(): void
31+
{
32+
Gate::define('viewHorizon', function (User $user): bool {
33+
return $user->isAdmin();
34+
});
35+
}
36+
}

bootstrap/providers.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44

55
return [
66
App\Providers\AppServiceProvider::class,
7+
App\Providers\HorizonServiceProvider::class,
78
App\Providers\FilamentServiceProvider::class,
89
App\Providers\Filament\AdminPanelProvider::class,
910
Aedart\Antivirus\Providers\AntivirusServiceProvider::class,

composer.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
"jeffgreco13/filament-breezy": "^3.2",
1818
"kalnoy/nestedset": "^7.0",
1919
"laravel/framework": "^13.16",
20+
"laravel/horizon": "^5.48",
2021
"laravel/sanctum": "^4.3",
2122
"laravel/tinker": "^3.0",
2223
"maatwebsite/excel": "^3.1",

composer.lock

Lines changed: 217 additions & 57 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)