Никола Стојков
Никола Стојков
FFilament
Created by Никола Стојков on 2/3/2025 in #❓┊help
Moving the code to another server hides resources
As the title suggests, I tried deploying my Filament code to a "production" server and I'm suddenly missing resources in the menu. Same code, same DB (even dumped it instead of migrations to make sure), no roles or permissions or anything like that that would hide them. Also kidna no pattern, sometimes it's resources, a couple of custom pages, no overlapping logic that would make sense. Any points as to the obvious thing I"m missing? I might be a bit sleep deprived 😄
5 replies
FFilament
Created by Никола Стојков on 1/4/2025 in #❓┊help
Help with action modal
Hi everyone, I'm trying to have a action modal rendered via a panel render hook, but I can't seem to get the action to do anything. Trying multiple YouTube videos/tutorials, it's not even giving me an error, just not doing anything. Livewire component:
class SwitchHotels extends Component implements HasActions, HasForms
{
use InteractsWithActions;
use InteractsWithForms;

public function renderHotelSwitch()
{
return Action::make('switchHotel')
->label('Switch Hotel')
->icon('heroicon-m-building-office-2')
->form([
Select::make('hotel_id')
->label('Switch Hotel')
->options(function () {
return Hotel::pluck('name', 'id')->toArray();
})
->required()
])
->action(function (array $data): void {
$hotel = Hotel::findOrFail($data['hotel_id']);

auth()->user()->update([
'current_hotel_id' => $hotel->id
]);

$this->redirect(request()->header('Referer'));
});
}

public function render()
{
return view('livewire.switch-hotels');
}
}
class SwitchHotels extends Component implements HasActions, HasForms
{
use InteractsWithActions;
use InteractsWithForms;

public function renderHotelSwitch()
{
return Action::make('switchHotel')
->label('Switch Hotel')
->icon('heroicon-m-building-office-2')
->form([
Select::make('hotel_id')
->label('Switch Hotel')
->options(function () {
return Hotel::pluck('name', 'id')->toArray();
})
->required()
])
->action(function (array $data): void {
$hotel = Hotel::findOrFail($data['hotel_id']);

auth()->user()->update([
'current_hotel_id' => $hotel->id
]);

$this->redirect(request()->header('Referer'));
});
}

public function render()
{
return view('livewire.switch-hotels');
}
}
And How I render it:
FilamentView::registerRenderHook(PanelsRenderHook::GLOBAL_SEARCH_AFTER, function() {
return Blade::render("<livewire:switch-hotels />");
});
FilamentView::registerRenderHook(PanelsRenderHook::GLOBAL_SEARCH_AFTER, function() {
return Blade::render("<livewire:switch-hotels />");
});
Any help appreciated.
10 replies
FFilament
Created by Никола Стојков on 12/9/2024 in #❓┊help
I'm about lost with a weird error
Sorry if this was asked before, but after googling the error, reading through the docs, and trying out multiple things, I'm either an idiot or I can't find info on this error, and I've been trying for a while today. The error is No synthesizer found for key: "" and it happens when I'm using the FormUpload component. Now, the funny thing is that I use the same exact code, which is:
FileUpload::make('image')
->label('Image')
->directory('menu-items')
->image()
->nullable(),
FileUpload::make('image')
->label('Image')
->directory('menu-items')
->image()
->nullable(),
and it works perfectly in my resource. But, I've created a separate page for "Settings", and all the fields work perfectly except the file upload, which yields this error. The FileUpload code is identical sans the label. Any pointers as to where I shold look to debug this further is greatly appreciated, seeing as the stack error gives me about 0 info.
6 replies