Skip to content

Commit

Permalink
Add support for Laravel Horizon 5.24.4 (#3)
Browse files Browse the repository at this point in the history
* Add support for Laravel Horizon 5.24.4
* Fix typos
  • Loading branch information
jacobdekeizer authored May 8, 2024
1 parent 820bf38 commit b4ce4bd
Show file tree
Hide file tree
Showing 10 changed files with 20 additions and 282 deletions.
13 changes: 12 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,17 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [3.2.0] - UNRELEASED

### Added

- Added support for Laravel Horizon 5.24.4.

### Deprecated

- The `HORIZON_USE_DARK_THEME` environment variable can be removed. The dark theme is now based on the system settings.
- The `horizon:publish` command can be removed. The assets don't need to be published anymore.

## [3.1.1] - 2023-02-06

### Changed
Expand Down Expand Up @@ -50,7 +61,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

### Changed
- The location of the Horizon assets has been changed. The Horizon assets are published into the plugin directory itself (`plugins/vdlp/horizon/assets`). Please note that you need to re-publish the assets when you are deploying your October CMS website or application using the `php artisan horizon:assets` command otherwise the Horizon Dashboard will not be available.
- The `horizon:assets` command can now be used to (re-)publish the Horizon Assets required for the Horizon Dashboard.
- The `horizon:assets` command can now be used to (re-)publish the Horizon Assets required for the Horizon Dashboard.
- Renamed `PushExampleJobs` to `PushExampleJobsCommand`.

### Removed
Expand Down
16 changes: 4 additions & 12 deletions Plugin.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,6 @@

final class Plugin extends PluginBase
{
private Backend $backend;

public function __construct($app)
{
parent::__construct($app);

$this->backend = resolve(Backend::class);
}

public function pluginDetails(): array
{
return [
Expand Down Expand Up @@ -52,8 +43,6 @@ public function boot(): void
|| $user->isSuperUser();
});

Horizon::$useDarkTheme = config('vdlp.horizon::use_dark_theme', true);

$this->bootNotificationSettings();

if (config('app.debug') === true) {
Expand Down Expand Up @@ -87,10 +76,13 @@ public function registerPermissions(): array

public function registerNavigation(): array
{
/** @var Backend $backend */
$backend = $this->app->make(Backend::class);

return [
'dashboard' => [
'label' => 'Horizon',
'url' => $this->backend->url('vdlp/horizon/dashboard'),
'url' => $backend->url('vdlp/horizon/dashboard'),
'iconSvg' => '/plugins/vdlp/horizon/assets/icons/horizon.svg',
'permissions' => ['vdlp.horizon.access_dashboard'],
'order' => 500,
Expand Down
12 changes: 1 addition & 11 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,22 +50,12 @@ You should add the `dont-discover` option to your projects `composer.json` file
> IMPORTANT: Make sure the `composer.json` is deployed to your hosting site. This will be parsed by te framework to determine which service providers should be ignored.
## Assets & Configuration
## Configuration

```
php artisan horizon:install
```

## Update Horizon Assets

To update the Horizon Assets you can use the following command:

```
php artisan horizon:publish
```

> IMPORTANT: Add the above command to your deployment logic or composer update scripts. This way the assets will always be up to date on your staging or production environment.
* Configure Laravel Horizon settings file at `config/horizon.php`, please make sure `use` contains `horizon` (see the configuration snippet below).

```
Expand Down
55 changes: 0 additions & 55 deletions classes/PathHelper.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 @@ -25,7 +25,7 @@
"ext-posix": "*",
"ext-redis": "*",
"composer/installers": "^1.0 || ^2.0",
"laravel/horizon": "^5.0",
"laravel/horizon": "^5.24.4",
"october/rain": "^3.0"
},
"require-dev": {
Expand Down
2 changes: 0 additions & 2 deletions config/config.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,4 @@
'sms_notifications_enabled' => env('HORIZON_SMS_NOTIFICATIONS_ENABLED', false),
'sms_notifications_to' => env('HORIZON_SMS_NOTIFICATIONS_TO'),

'use_dark_theme' => env('HORIZON_USE_DARK_THEME', true),

];
28 changes: 0 additions & 28 deletions http/controllers/HomeController.php

This file was deleted.

29 changes: 0 additions & 29 deletions serviceproviders/HorizonServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,20 +4,12 @@

namespace Vdlp\Horizon\ServiceProviders;

use Illuminate\Support\Facades\Route;
use Laravel\Horizon;
use Laravel\Horizon\HorizonServiceProvider as HorizonServiceProviderBase;
use Vdlp\Horizon\Listeners\SendNotification;

final class HorizonServiceProvider extends HorizonServiceProviderBase
{
public function defineAssetPublishing(): void
{
$this->publishes([
HORIZON_PATH . '/public' => plugins_path('vdlp/horizon/assets'),
], 'horizon-assets');
}

protected function registerEvents(): void
{
$this->events[Horizon\Events\LongWaitDetected::class] = [
Expand All @@ -26,25 +18,4 @@ protected function registerEvents(): void

parent::registerEvents();
}

protected function registerResources(): void
{
$this->loadViewsFrom(plugins_path('vdlp/horizon/views'), 'horizon');
}

protected function registerRoutes(): void
{
parent::registerRoutes();

Route::group([
'domain' => config('horizon.domain'),
'prefix' => config('horizon.path'),
'namespace' => 'Vdlp\Horizon\Http\Controllers',
'middleware' => config('horizon.middleware', 'web'),
], static function (): void {
Route::get('/{view?}', 'HomeController@index')
->where('view', '(.*)')
->name('horizon.index');
});
}
}
3 changes: 2 additions & 1 deletion updates/version.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,5 @@ v3.0.0: "Upgrade to Horizon 5.x"
v3.1.0:
- "Add migration for Job Batches table"
- 20220923_0001_create_job_batches_table.php
v3.1.1: "Update Horizon Dashboard Layout (new UI)"
v3.1.1: "Update Horizon Dashboard Layout (new UI)"
v3.2.0: "Add support for Horizon 5.24.4"
142 changes: 0 additions & 142 deletions views/layout.blade.php

This file was deleted.

0 comments on commit b4ce4bd

Please sign in to comment.