snipe-it/app/Providers/LivewireServiceProvider.php

33 lines
719 B
PHP
Raw Normal View History

<?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);
});
}
}