hxn
hxn
FFilament
Created by hxn on 3/20/2024 in #❓┊help
Multi dimensional KeyValue
All i have is two KeyValue component Forms\Components\KeyValue::make('company'), Forms\Components\KeyValue::make('company.address'),
7 replies
FFilament
Created by hxn on 3/20/2024 in #❓┊help
Multi dimensional KeyValue
Thanks for your reply @toeknee What i'm supposed to do with formatStateUsing? How do I target the specific address input and disable it?
7 replies
FFilament
Created by hxn on 3/20/2024 in #❓┊help
Multi dimensional KeyValue
No description
7 replies
FFilament
Created by hxn on 10/14/2023 in #❓┊help
conditional table column
I've finally opted for the custom view because I don't necessarily need a curatorColumn SettingsResource.php
return $table
->columns([
...
Tables\Columns\ViewColumn::make('value')->view('filament.tables.columns.settingColumn'),
])
...
return $table
->columns([
...
Tables\Columns\ViewColumn::make('value')->view('filament.tables.columns.settingColumn'),
])
...
settingColumn.blade.php
<div class="w-16 flex items-center justify-center">
@php
$type = $getRecord()->type;
$render = null;
switch ($type) {
case 'media':
$media = Awcodes\Curator\Models\Media::where('id', $getState())->first();
$render = $media ? $media->url : false;
break;
default:
$render = $getState();
break;
}
@endphp
@switch($type)
@case("media")
@if ($render)
<img class="w-10 h-10 rounded-full" src="{{ $render }}">
@else
None
@endif
@break
@case("boolean")
{{ $render === "0" ? "False" : "True" }}
@break
@default
{{ $render }}
@endswitch
</div>
<div class="w-16 flex items-center justify-center">
@php
$type = $getRecord()->type;
$render = null;
switch ($type) {
case 'media':
$media = Awcodes\Curator\Models\Media::where('id', $getState())->first();
$render = $media ? $media->url : false;
break;
default:
$render = $getState();
break;
}
@endphp
@switch($type)
@case("media")
@if ($render)
<img class="w-10 h-10 rounded-full" src="{{ $render }}">
@else
None
@endif
@break
@case("boolean")
{{ $render === "0" ? "False" : "True" }}
@break
@default
{{ $render }}
@endswitch
</div>
10 replies
FFilament
Created by hxn on 10/14/2023 in #❓┊help
conditional table column
Thanks for this workaround i will dig into it
10 replies
FFilament
Created by hxn on 10/14/2023 in #❓┊help
conditional table column
Or maybe it's not possible?
10 replies
FFilament
Created by hxn on 7/20/2023 in #❓┊help
Custom page with filament blade component
@Leandro Ferreira Thanks for pointing me to the right direction 🙂
4 replies
FFilament
Created by hxn on 5/8/2023 in #❓┊help
Select options not updated when using "create & create another" button
Fixed! Thanks a lot
8 replies
FFilament
Created by hxn on 5/8/2023 in #❓┊help
Select options not updated when using "create & create another" button
I have similar(minor) problem on headerActions:
->headerActions([
Tables\Actions\CreateAction::make()
->disabled(fn (RelationManager $livewire) => !$livewire->ownerRecord->getUnsetLocales())
->disableCreateAnother(),
])
->headerActions([
Tables\Actions\CreateAction::make()
->disabled(fn (RelationManager $livewire) => !$livewire->ownerRecord->getUnsetLocales())
->disableCreateAnother(),
])
If i create the last possible translation and save it. The button to create a new record in the relation is still in primary color (but its a minor issue cause when clicking on it it does nothing). Only after refreshing the page the color is darker as expected
8 replies
FFilament
Created by hxn on 5/8/2023 in #❓┊help
Select options not updated when using "create & create another" button
public function getUnsetLocales() {
$translations = collect(['en' => 'en', 'pt' => 'pt']);
$options = $this->category_translations->map(fn($item) => $item->locale);

return $translations->diff($options)->toArray();
}
public function getUnsetLocales() {
$translations = collect(['en' => 'en', 'pt' => 'pt']);
$options = $this->category_translations->map(fn($item) => $item->locale);

return $translations->diff($options)->toArray();
}
any idea how to trigger a refresh when user press the "create & create another"?
8 replies
FFilament
Created by hxn on 5/8/2023 in #❓┊help
Select options not updated when using "create & create another" button
For now i've just disabled CreateAnother but if someone have another solution to achieve what i want it will be great (getUnsetLocales() simply return an array of non used locales)
->headerActions([
Tables\Actions\CreateAction::make()
->disableCreateAnother(),
Tables\Actions\AssociateAction::make(),
])
->headerActions([
Tables\Actions\CreateAction::make()
->disableCreateAnother(),
Tables\Actions\AssociateAction::make(),
])
8 replies
FFilament
Created by hxn on 5/8/2023 in #❓┊help
Uploaded image not deleted on delete
thanks, I will probably make an observer if there is no other option in filament
14 replies
FFilament
Created by hxn on 5/8/2023 in #❓┊help
Uploaded image not deleted on delete
Using $this when not in object context
Using $this when not in object context
14 replies
FFilament
Created by hxn on 5/8/2023 in #❓┊help
Uploaded image not deleted on delete
Thanks for your reply
14 replies