cpereiraweb
cpereiraweb
Explore posts from servers
FFilament
Created by Rome on 1/11/2024 in #❓┊help
SubNavigation labels
Man, thanks a lot
5 replies
FFilament
Created by cpereiraweb on 8/17/2023 in #❓┊help
Accessor as a column in the Attach action on a RelationManager
Patrick, first of all, thank you for your attention. I saw this option but I understood that it would only be to customize the placeholder of the select. I'll take a look at the code for the class and see if I can find a way to do what I need. 😃
8 replies
FFilament
Created by cpereiraweb on 8/17/2023 in #❓┊help
Accessor as a column in the Attach action on a RelationManager
->headerActions([
Tables\Actions\AttachAction::make()
->recordSelectSearchColumns(['km_id', 'description'])
->preloadRecordSelect(),
])
->headerActions([
Tables\Actions\AttachAction::make()
->recordSelectSearchColumns(['km_id', 'description'])
->preloadRecordSelect(),
])
8 replies
FFilament
Created by cpereiraweb on 8/17/2023 in #❓┊help
Accessor as a column in the Attach action on a RelationManager
Sure:
<?php

namespace App\Models
//...
class Item extends Model
{
protected $appends = [
'item_name'
];

protected function itemName(): Attribute
{
return Attribute::make(
get: fn() => sprintf("%s - %s", $this->km_id, $this->description),
);
}
//...
<?php

namespace App\Models
//...
class Item extends Model
{
protected $appends = [
'item_name'
];

protected function itemName(): Attribute
{
return Attribute::make(
get: fn() => sprintf("%s - %s", $this->km_id, $this->description),
);
}
//...
8 replies
FFilament
Created by cpereiraweb on 3/16/2023 in #❓┊help
Validation rule active only when creating a record
I'm using in Resource class. I'll try this 😃
12 replies
FFilament
Created by cpereiraweb on 3/16/2023 in #❓┊help
Validation rule active only when creating a record
I intended to use TextInput::make('birth_date')->disabled() on edit screen.
12 replies
FFilament
Created by cpereiraweb on 3/16/2023 in #❓┊help
Validation rule active only when creating a record
I'll try this. Thanks 😃
12 replies
FFilament
Created by cpereiraweb on 3/16/2023 in #❓┊help
Validation rule active only when creating a record
Let me explain the scenario: when enrolling a student, I need to verify that the student is between 11 and 47 months old. This check is only required when creating the record. On the editing screen, the date of birth field will be blocked.
12 replies
FFilament
Created by cpereiraweb on 3/16/2023 in #❓┊help
Validation rule active only when creating a record
Actually I expected to have the possibility to use a callback function to achieve this but I didn't find how. I will try this approach. Thanks for sharing!
12 replies