F
Filament14mo ago
Pasteko

Shared hosting deployment

Hello, I have a problem to deploy my filament app to a shared hosting. With Filament v2 I was forced to publish the livewire config and set : 'asset_url' => '' In livewire 3 asset_url is replaced by :
Livewire::setScriptRoute(function ($handle) {
return Route::get('/custom/livewire/livewire.js', $handle);
});
Livewire::setScriptRoute(function ($handle) {
return Route::get('/custom/livewire/livewire.js', $handle);
});
But I don't know where (file) I need to add this?
3 Replies
Sanchit Patil
Sanchit Patil14mo ago
it will go inside your panel provider. for e.g. AdminPanelProvider.php
public function boot(): void
{
Livewire::setScriptRoute(function ($handle) {
return Route::get('/custom/livewire/livewire.js', $handle);
});
}
public function boot(): void
{
Livewire::setScriptRoute(function ($handle) {
return Route::get('/custom/livewire/livewire.js', $handle);
});
}
Pasteko
PastekoOP14mo ago
It gives me : Class "App\Providers\Filament\Livewire" not found
cheesegrits
cheesegrits14mo ago
C'mon, that's just PHP 101. You need to either include the namespace on Livewire::foo(), or add a 'use' for it. Your IDE should offer to do that for you.
use Livewire\Livewire;

//

public function boot(): void
{
Livewire::setScriptRoute(function ($handle) {
return Route::get('/custom/livewire/livewire.js', $handle);
});
}
use Livewire\Livewire;

//

public function boot(): void
{
Livewire::setScriptRoute(function ($handle) {
return Route::get('/custom/livewire/livewire.js', $handle);
});
}
Want results from more Discord servers?
Add your server