mirror of
https://bitbucket.org/studiotem/jandl-taskmanager-app.git
synced 2026-10-21 14:29:34 +00:00
no message
This commit is contained in:
1 parent
8b046c3e8b
commit
7ec929e0a9
2 files changed
+1
-45
No files matched your search
@@ -1,38 +0,0 @@
|
|||||||
<?php
|
|
||||||
|
|
||||||
namespace App\Http\Controllers;
|
|
||||||
|
|
||||||
use Illuminate\Support\Facades\App;
|
|
||||||
use Illuminate\Support\Str;
|
|
||||||
use Laravel\Horizon\Horizon;
|
|
||||||
use Laravel\Horizon\Http\Controllers\HomeController;
|
|
||||||
|
|
||||||
class HorizonHomeController extends HomeController
|
|
||||||
{
|
|
||||||
/**
|
|
||||||
* Overrides default horizon route to support subdirectory hosting.
|
|
||||||
*/
|
|
||||||
public function index ()
|
|
||||||
{
|
|
||||||
// We use a plain request to check for the base url.
|
|
||||||
$request = request();
|
|
||||||
|
|
||||||
// Set up our base path.
|
|
||||||
$base_path = Str::substr($request->getBasePath(), 1);
|
|
||||||
if (!empty($base_path)) {
|
|
||||||
$base_path .= '/';
|
|
||||||
}
|
|
||||||
|
|
||||||
// Patch default horizon variables with our own base path.
|
|
||||||
$variables = Horizon::scriptVariables();
|
|
||||||
$variables['path'] = $base_path . config('horizon.path');
|
|
||||||
|
|
||||||
// Render horizon's home view.
|
|
||||||
return view('horizon::layout', [
|
|
||||||
'assetsAreCurrent' => Horizon::assetsAreCurrent(),
|
|
||||||
'horizonScriptVariables' => $variables,
|
|
||||||
'cssFile' => Horizon::$useDarkTheme ? 'app-dark.css' : 'app.css',
|
|
||||||
'isDownForMaintenance' => App::isDownForMaintenance(),
|
|
||||||
]);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -2,9 +2,7 @@
|
|||||||
|
|
||||||
namespace App\Providers;
|
namespace App\Providers;
|
||||||
|
|
||||||
use App\Http\Controllers\HorizonHomeController;
|
|
||||||
use Illuminate\Support\ServiceProvider;
|
use Illuminate\Support\ServiceProvider;
|
||||||
use Laravel\Horizon\Http\Controllers\HomeController;
|
|
||||||
|
|
||||||
class AppServiceProvider extends ServiceProvider
|
class AppServiceProvider extends ServiceProvider
|
||||||
{
|
{
|
||||||
@@ -15,11 +13,7 @@ class AppServiceProvider extends ServiceProvider
|
|||||||
*/
|
*/
|
||||||
public function register()
|
public function register()
|
||||||
{
|
{
|
||||||
// Horizon's subdirectory hack
|
//
|
||||||
$this->app->bind(
|
|
||||||
HomeController::class,
|
|
||||||
HorizonHomeController::class
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
Reference in new issue
Block a user