mpiet
mpiet
FFilament
Created by mpiet on 7/9/2024 in #❓┊help
Why isn't it the same?
I extracted a few action into separate classes. Why does this work:
public function chooseLinkTarget(): ActionGroup
{
return ActionGroup::make([
$this->createLinkToProject(),
]);
}

protected function createLinkToProject()
{
return CreateLinkToProject::make();
}
public function chooseLinkTarget(): ActionGroup
{
return ActionGroup::make([
$this->createLinkToProject(),
]);
}

protected function createLinkToProject()
{
return CreateLinkToProject::make();
}
but not this:
public function chooseLinkTargetType(): ActionGroup
{
return ActionGroup::make([
CreateLinkToProject::make(),
]);
}
public function chooseLinkTargetType(): ActionGroup
{
return ActionGroup::make([
CreateLinkToProject::make(),
]);
}
The action modal won't open in the last example.
2 replies
FFilament
Created by mpiet on 5/6/2024 in #❓┊help
Can I disable the loading indicator for actions that open a modal?
To me loading indicators only make sense for actions that take longer than usual. The modals open right away. Still the indicator shows for a moment.
9 replies
FFilament
Created by mpiet on 4/24/2024 in #❓┊help
Action in custom modal content: Update modal content after action performed?
I have a page that renders records. I have an action to open a modal. I pass a subset of records to this modal action. I render the subset of records in the custom modal content. I also added an action to delete a single record. The overall page updates, and the record is removed. But inside the custom modal content I still see the record. How can I update the modal content? Or make it reactive? Here's some code:
{{
($this->editRates)([
'rates' => $day['rates']
])
}}
{{
($this->editRates)([
'rates' => $day['rates']
])
}}
public function editRates(): Action
{
return Action::make('editRates')
->registerModalActions([
$this->removeRate(),
])
->modalContent(
function (Action $action) {
return view('edit-rates', [
'action' => $action
]);
}
);
}
public function editRates(): Action
{
return Action::make('editRates')
->registerModalActions([
$this->removeRate(),
])
->modalContent(
function (Action $action) {
return view('edit-rates', [
'action' => $action
]);
}
);
}
@foreach($action->getArguments()['rates'] as $rate)
<div>
{{ ($action->getModalAction('removeRate'))([ 'id' => $rate['id'] ]) }}
</div>
@endforeach
@foreach($action->getArguments()['rates'] as $rate)
<div>
{{ ($action->getModalAction('removeRate'))([ 'id' => $rate['id'] ]) }}
</div>
@endforeach
3 replies
FFilament
Created by mpiet on 4/22/2024 in #❓┊help
Different colors for light and dark mode?
Is it possible to register colors like "primary" differently for light and dark mode?
4 replies
FFilament
Created by mpiet on 4/3/2024 in #❓┊help
How to enforce client loads newest theme.css?
We build the theme CSS on each deploy. How can we tell clients to ignore local cache, and load the newest /public/css/filament/admin/theme.css?
7 replies
FFilament
Created by mpiet on 3/25/2024 in #❓┊help
Possible to customise the same widget in different styles?
No description
2 replies
FFilament
Created by mpiet on 3/10/2024 in #❓┊help
Docs for table: return type doesn't seem to match contract
I get Declaration of App\Livewire\ListProducts::table(Filament\Tables\Table $table): Filament\Tables\Table must be compatible with Filament\Tables\Actions\Contracts\HasTable::table(Filament\Tables\Table $table): static when I copy public function table(Table $table): Table { ... from the docs at https://filamentphp.com/docs/3.x/tables/adding-a-table-to-a-livewire-component What could I be missing?
3 replies