Amitoj
Amitoj
FFilament
Created by Amitoj on 8/31/2024 in #❓┊help
url() is disrupting table columns
No description
3 replies
FFilament
Created by rabol on 5/24/2023 in #❓┊help
How come filename include the directory
I have same concern, I only want to save filename in the database regardless in which directory the file goes. Do you think it make sense to use laravel's model accessor to change the value when saving and accessing:
protected function icon(): Attribute{
return Attribute::make(
get: fn(string $value) => $value ? storage('company.icon.path') . '/' . $value : null,
set: fn($value) => $value ? basename($value) : null
);
}
protected function icon(): Attribute{
return Attribute::make(
get: fn(string $value) => $value ? storage('company.icon.path') . '/' . $value : null,
set: fn($value) => $value ? basename($value) : null
);
}
This seems to be working, but can someone confirm if it is reliable for filament or if there is better approach?
75 replies
FFilament
Created by Amitoj on 5/28/2024 in #❓┊help
HasOne relationship not updating foreignKey in parent model
You are right, Thanks you fixed the issue, I am sorry that the parameters had me confused. In hasOne relationship, foreign_key is actually supposed to be parent's id column in child entity, which in my case would be project_id (or no need to mention as you said). I thought I would only need the project_id column in belongsTo relation because it would save me a column. Now I removed attachment_id because its no longer in use.
9 replies
FFilament
Created by Amitoj on 4/10/2024 in #❓┊help
Distorted Menu Button & Modals
😂😂absolutely
26 replies
FFilament
Created by Amitoj on 4/10/2024 in #❓┊help
Distorted Menu Button & Modals
I appreciate your concern, Its not long term project, so it doesnt matter for me.
26 replies
FFilament
Created by Amitoj on 4/10/2024 in #❓┊help
Distorted Menu Button & Modals
Yes I believe that too, but im leaving it here for the record if it happens again, thanks
26 replies
FFilament
Created by Amitoj on 4/10/2024 in #❓┊help
Distorted Menu Button & Modals
Issue is resolved from my end, thank you everyone, you might like to raise an github issue for this one.
26 replies
FFilament
Created by Amitoj on 4/10/2024 in #❓┊help
Distorted Menu Button & Modals
No description
26 replies
FFilament
Created by Amitoj on 4/10/2024 in #❓┊help
Distorted Menu Button & Modals
I hope I am wrong as you guys might be using css libraries to really make this css classes important which is not working in my case.
26 replies
FFilament
Created by Amitoj on 4/10/2024 in #❓┊help
Distorted Menu Button & Modals
No description
26 replies
FFilament
Created by Amitoj on 4/10/2024 in #❓┊help
Distorted Menu Button & Modals
No description
26 replies
FFilament
Created by Amitoj on 4/10/2024 in #❓┊help
Distorted Menu Button & Modals
No description
26 replies
FFilament
Created by Amitoj on 4/10/2024 in #❓┊help
Distorted Menu Button & Modals
I tried everything, none of it came forward, I did my own research and I assume that the ! in css classes are causing issue
26 replies
FFilament
Created by Amitoj on 4/10/2024 in #❓┊help
Distorted Menu Button & Modals
Okay, lets see
26 replies
FFilament
Created by Amitoj on 4/10/2024 in #❓┊help
Distorted Menu Button & Modals
I run the command, it didnt work, I also clear server and browser cache, didnt work.
26 replies
FFilament
Created by Amitoj on 4/10/2024 in #❓┊help
Distorted Menu Button & Modals
No description
26 replies
FFilament
Created by Amitoj on 4/10/2024 in #❓┊help
Distorted Menu Button & Modals
It makes sense that it is happening because of lack of files generated by npm build, I have question, is there any other way around to copy the generated files from local machine to the host as the host cannot have nodejs at all. I attempted to copy the node_modules and public/build directories but I dont think it worked.
26 replies
FFilament
Created by Amitoj on 10/5/2023 in #❓┊help
How to get search record after choosing SELECT option?
Alright I figured it out, I used Select $component to get the values:
Select::make('user_id')
->label('Customer Email')
->relationship(name: 'user', titleAttribute: 'email')
->searchable()
->preload()
->required()
->live()
->afterStateUpdated(function (Select $component, Set $set) {
$model = $component->getSelectedRecord();
$set('recipient_name', $model->name);
$set('phone_number', $model->phone_number);
}),
TextInput::make('recipient_name')
->maxLength(50)
->required(),
TextInput::make('phone_number')
->numeric()
->required()
Select::make('user_id')
->label('Customer Email')
->relationship(name: 'user', titleAttribute: 'email')
->searchable()
->preload()
->required()
->live()
->afterStateUpdated(function (Select $component, Set $set) {
$model = $component->getSelectedRecord();
$set('recipient_name', $model->name);
$set('phone_number', $model->phone_number);
}),
TextInput::make('recipient_name')
->maxLength(50)
->required(),
TextInput::make('phone_number')
->numeric()
->required()
4 replies