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
afa7448cf4
commit
f0dc19eaf4
2 files changed
+45
-1
No files matched your search
@@ -0,0 +1,38 @@
|
|||||||
|
<?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,7 +2,9 @@
|
|||||||
|
|
||||||
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
|
||||||
{
|
{
|
||||||
@@ -13,7 +15,11 @@ 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