Majid Al Zariey
Majid Al Zariey
FFilament
Created by Majid Al Zariey on 1/2/2024 in #❓┊help
Styling Select Input
Hello Team, Is it possible to style the Select Input (not native) when value is selected, eg. change background color, without having to modify it in AfterStateUpdated (Assuming it would be slow). Tried to figure out a CSS selector for the selected state. Thanks in advance
2 replies
FFilament
Created by Majid Al Zariey on 6/24/2023 in #❓┊help
JSON Values and Hidden Fields
I am using the following fields attached (statePath) to a JSON column:
Grid::make(2)->statePath('measure')->schema([
TextInput::make("min")->numeric()->reactive(),
TextInput::make("max")->numeric()->reactive(),
TextInput::make("rec-min")->numeric()->reactive()->visible(fn($get) => $get("min") != $get("max")),
TextInput::make("rec-max")->numeric()->reactive()->visible(fn($get) => $get("min") != $get("max")),
TextInput::make("default")->numeric()->visible(fn($get) => $get("rec-min") != $get("rec-max")),
])->visible(fn($get) => $get('type') == 1 ||$get('type') == 3 || $get('type') == 5),
Grid::make(2)->statePath('measure')->schema([
TextInput::make("min")->numeric()->reactive(),
TextInput::make("max")->numeric()->reactive(),
TextInput::make("rec-min")->numeric()->reactive()->visible(fn($get) => $get("min") != $get("max")),
TextInput::make("rec-max")->numeric()->reactive()->visible(fn($get) => $get("min") != $get("max")),
TextInput::make("default")->numeric()->visible(fn($get) => $get("rec-min") != $get("rec-max")),
])->visible(fn($get) => $get('type') == 1 ||$get('type') == 3 || $get('type') == 5),
The output of the repeater is a JSON object with the following keys: min, max, rec-min, rec-max, and default. If the values of the min and max fields are equal, the rec-min and rec-max fields are hidden and their values are null in the JSON object. I have two questions about this: 1- How do I keep the values of the min, max, rec-min, and rec-max fields as integers? 2- Is there an ability to not dehydrate the fields if they are hidden? All the fields were hidden:
{"min":null,"max":null,"rec-min":null,"rec-max":null,"default":null}
{"min":null,"max":null,"rec-min":null,"rec-max":null,"default":null}
The fields where partially visible with some values:
"min":"10","max":"30","rec-min":null,"rec-max":null,"default":null}
"min":"10","max":"30","rec-min":null,"rec-max":null,"default":null}
Field cast in Eloquent
protected $casts = [
'measure' => 'json'
];
protected $casts = [
'measure' => 'json'
];
4 replies
FFilament
Created by Majid Al Zariey on 6/8/2023 in #❓┊help
Save hidden field
Is there any better way to apply the following
Forms\Components\Toggle::make('expires')->reactive()->afterStateUpdated(
function ($state, callable $set) {
if (!$state) { $set('expire_date', null);
$set('expireDate', null);
}})
->inline(false)->required(),
Hidden::make('expire_date')->afterStateHydrated(
function ($state,$set){
$set('expireDate', $state);
}),
Forms\Components\DatePicker::make('expireDate')->closeOnDateSelection()->visible(fn(callable $get) => $get('expires'))->afterStateUpdated(
function ($state,$set){
$set('expire_date', $state);
}),
Forms\Components\Toggle::make('expires')->reactive()->afterStateUpdated(
function ($state, callable $set) {
if (!$state) { $set('expire_date', null);
$set('expireDate', null);
}})
->inline(false)->required(),
Hidden::make('expire_date')->afterStateHydrated(
function ($state,$set){
$set('expireDate', $state);
}),
Forms\Components\DatePicker::make('expireDate')->closeOnDateSelection()->visible(fn(callable $get) => $get('expires'))->afterStateUpdated(
function ($state,$set){
$set('expire_date', $state);
}),
9 replies
FFilament
Created by Majid Al Zariey on 5/19/2023 in #❓┊help
Plugins assets in Form Builder
In form builder do I need to import plugins assets into my app.js for them to work, or is there an issue with my configuration?
5 replies
FFilament
Created by Majid Al Zariey on 5/18/2023 in #❓┊help
Repeat small elements with DataList Input
6 replies
FFilament
Created by Majid Al Zariey on 5/16/2023 in #❓┊help
FilamentPHP closure definition
Where is FilamentPHP closure parameters defined in filament, for example Section's schema closure. I want to know which parameters I am able to receive from each closure.
9 replies
FFilament
Created by Majid Al Zariey on 5/14/2023 in #❓┊help
New issue with select after v2.17.39
20 replies