mirror of
https://github.com/snipe/snipe-it.git
synced 2024-11-09 23:24:06 -08:00
Allow setting a prefix for Livewire's update and asset urls
This commit is contained in:
parent
5132aa0254
commit
9dd3827222
|
@ -183,6 +183,7 @@ REPORT_TIME_LIMIT=12000
|
||||||
REQUIRE_SAML=false
|
REQUIRE_SAML=false
|
||||||
API_THROTTLE_PER_MINUTE=120
|
API_THROTTLE_PER_MINUTE=120
|
||||||
CSV_ESCAPE_FORMULAS=true
|
CSV_ESCAPE_FORMULAS=true
|
||||||
|
LIVEWIRE_URL_PREFIX=null
|
||||||
|
|
||||||
# --------------------------------------------
|
# --------------------------------------------
|
||||||
# OPTIONAL: HASHING
|
# OPTIONAL: HASHING
|
||||||
|
|
32
app/Providers/LivewireServiceProvider.php
Normal file
32
app/Providers/LivewireServiceProvider.php
Normal file
|
@ -0,0 +1,32 @@
|
||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Providers;
|
||||||
|
|
||||||
|
use Illuminate\Support\Facades\Route;
|
||||||
|
use Illuminate\Support\ServiceProvider;
|
||||||
|
use Livewire\Livewire;
|
||||||
|
|
||||||
|
class LivewireServiceProvider extends ServiceProvider
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* Register services.
|
||||||
|
*/
|
||||||
|
public function register(): void
|
||||||
|
{
|
||||||
|
//
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Bootstrap services.
|
||||||
|
*/
|
||||||
|
public function boot(): void
|
||||||
|
{
|
||||||
|
Livewire::setUpdateRoute(function ($handle) {
|
||||||
|
return Route::post('/' . config('livewire.url_prefix') . '/livewire/update', $handle);
|
||||||
|
});
|
||||||
|
|
||||||
|
Livewire::setScriptRoute(function ($handle) {
|
||||||
|
return Route::get('/' . config('livewire.url_prefix') . '/livewire/livewire.js', $handle);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
|
@ -311,8 +311,9 @@ return [
|
||||||
App\Providers\ValidationServiceProvider::class,
|
App\Providers\ValidationServiceProvider::class,
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Custom service provider
|
* Custom Service Providers...
|
||||||
*/
|
*/
|
||||||
|
App\Providers\LivewireServiceProvider::class,
|
||||||
App\Providers\MacroServiceProvider::class,
|
App\Providers\MacroServiceProvider::class,
|
||||||
App\Providers\SamlServiceProvider::class,
|
App\Providers\SamlServiceProvider::class,
|
||||||
|
|
||||||
|
|
|
@ -157,4 +157,21 @@ return [
|
||||||
*/
|
*/
|
||||||
|
|
||||||
'pagination_theme' => 'tailwind',
|
'pagination_theme' => 'tailwind',
|
||||||
|
|
||||||
|
/*
|
||||||
|
|---------------------------------------------------------------------------
|
||||||
|
| URL Prefix
|
||||||
|
|---------------------------------------------------------------------------
|
||||||
|
|
|
||||||
|
| By default, Livewire sends network requests to {app.com}/livewire/update
|
||||||
|
| while javascript assets are served via {app.com}/livewire/livewire.js
|
||||||
|
| If you need to adjust the prefix of those urls you can do it below.
|
||||||
|
|
|
||||||
|
| Defining a prefix will result in the following url
|
||||||
|
| {app.com}/{prefix}/livewire/{update|livewire.js}
|
||||||
|
| Note: do not include the leading or trailing /
|
||||||
|
|
|
||||||
|
*/
|
||||||
|
|
||||||
|
'url_prefix' => env('LIVEWIRE_URL_PREFIX', null),
|
||||||
];
|
];
|
||||||
|
|
Loading…
Reference in a new issue