Baspa
Baspa
FFilament
Created by Baspa on 7/5/2024 in #❓┊help
Stack component does not seem to respect `alignment`
Thanks!
4 replies
FFilament
Created by Baspa on 7/5/2024 in #❓┊help
Stack component does not seem to respect `alignment`
I want the image and text both on the same row. Is that possible?
4 replies
FFilament
Created by Baspa on 5/24/2024 in #❓┊help
Dynamically set the order for the widgets on each page
When I dump the value of $sort in the construct method of the widget it shows me the correct sort, but it seems like it's not respected by Filament?
public function __construct()
{
dump('weather sort: ' . self::$sort, self::getSort());
}
public function __construct()
{
dump('weather sort: ' . self::$sort, self::getSort());
}
3 replies
FFilament
Created by Baspa on 4/17/2024 in #❓┊help
The columnSpan on widgets is not working
Thanks!
10 replies
FFilament
Created by Baspa on 4/17/2024 in #❓┊help
The columnSpan on widgets is not working
Ah lol, that worked
10 replies
FFilament
Created by Baspa on 4/17/2024 in #❓┊help
The columnSpan on widgets is not working
When I set the columnSpan to full it does respect its width. But for the other sizes it somehow does not 🤔
10 replies
FFilament
Created by Baspa on 4/17/2024 in #❓┊help
The columnSpan on widgets is not working
No description
10 replies
FFilament
Created by Baspa on 4/17/2024 in #❓┊help
The columnSpan on widgets is not working
What do you mean? I defined the amount of columns, right?
10 replies
FFilament
Created by Baspa on 3/29/2024 in #❓┊help
How to prefix some routes or pages like ListRecords with '/admin' while others don't have the prefix
Alright, I will try that. Thanks!
4 replies
FFilament
Created by Baspa on 12/27/2023 in #❓┊help
How to populate multi select list with default selected values
Ah I found it, nvm thanks 😄
9 replies
FFilament
Created by Baspa on 12/27/2023 in #❓┊help
How to populate multi select list with default selected values
https://filamentphp.com/docs/3.x/actions/prebuilt-actions/edit#customizing-data-before-filling-the-form Is this the documentation about the method you mentioned? I tried to do so using this code, but it seems like mutateRecordDataUsing is not triggered:
public static function table(Table $table): Table
{
return $table
->columns([
Tables\Columns\TextColumn::make('name')
->label(__('Name'))
->sortable()
->searchable(),
Tables\Columns\TextColumn::make('created_at')
->label(__('Created at'))
->dateTime()
->sortable()
->toggleable(isToggledHiddenByDefault: true),
Tables\Columns\TextColumn::make('updated_at')
->label(__('Updated at'))
->dateTime()
->sortable()
->toggleable(isToggledHiddenByDefault: true),
])
->filters([
//
])
->actions([
Tables\Actions\EditAction::make()
->mutateRecordDataUsing(function (array $data): array {

$data['platforms'] = ChannelPlatformFrequency::query()
->where('channel_id', request()->route('record'))
->get()
->mapWithKeys(fn ($channelPlatformFrequency) => [$channelPlatformFrequency->platform_id => $channelPlatformFrequency->platform->name])
->toArray();

return $data;
})
])
->bulkActions([
Tables\Actions\BulkActionGroup::make([
Tables\Actions\DeleteBulkAction::make(),
]),
]);
}
public static function table(Table $table): Table
{
return $table
->columns([
Tables\Columns\TextColumn::make('name')
->label(__('Name'))
->sortable()
->searchable(),
Tables\Columns\TextColumn::make('created_at')
->label(__('Created at'))
->dateTime()
->sortable()
->toggleable(isToggledHiddenByDefault: true),
Tables\Columns\TextColumn::make('updated_at')
->label(__('Updated at'))
->dateTime()
->sortable()
->toggleable(isToggledHiddenByDefault: true),
])
->filters([
//
])
->actions([
Tables\Actions\EditAction::make()
->mutateRecordDataUsing(function (array $data): array {

$data['platforms'] = ChannelPlatformFrequency::query()
->where('channel_id', request()->route('record'))
->get()
->mapWithKeys(fn ($channelPlatformFrequency) => [$channelPlatformFrequency->platform_id => $channelPlatformFrequency->platform->name])
->toArray();

return $data;
})
])
->bulkActions([
Tables\Actions\BulkActionGroup::make([
Tables\Actions\DeleteBulkAction::make(),
]),
]);
}
9 replies
FFilament
Created by Baspa on 12/27/2023 in #❓┊help
How to populate multi select list with default selected values
Will try that! Thanks
9 replies
FFilament
Created by Baspa on 12/27/2023 in #❓┊help
How to populate multi select list with default selected values
Hmmm ok, which one should I use on the edit page?
9 replies
FFilament
Created by Baspa on 12/27/2023 in #❓┊help
How to populate multi select list with default selected values
On the edit page
9 replies
FFilament
Created by Baspa on 12/6/2023 in #❓┊help
Syntax error, unexpected token ";", expecting "]"
Ah seems like I already had a style directive which conflicts with Filament. So it has nothing to do with Filament itself. Thanks. @Dennis Koch
4 replies
FFilament
Created by Baspa on 12/6/2023 in #❓┊help
Syntax error, unexpected token ";", expecting "]"
When I comment this code it seems like it's working:
@style([
\Filament\Support\get_color_css_variables(
$iconColor,
shades: [100, 400, 500, 600],
alias: 'modal.icon',
) => $iconColor !== 'gray',
])
@style([
\Filament\Support\get_color_css_variables(
$iconColor,
shades: [100, 400, 500, 600],
alias: 'modal.icon',
) => $iconColor !== 'gray',
])
4 replies