Woojava
Woojava
FFilament
Created by Woojava on 10/11/2023 in #❓┊help
Confirming you cannot add a new model during an attach?
You have been incredibly helpful! Thanks! I got this to work: --- ->headerActions([ Tables\Actions\AttachAction::make() ->label('Attach Skill') ->preloadRecordSelect() ->recordSelectSearchColumns(['name']) ->recordSelect(function (Forms\Components\Select $select) { return $select ->placeholder('Select a skill to attach') ->searchable() ->createOptionForm([ TextInput::make('name') ->unique() ->label('Skill & Talent Name') ->required(), ]) ->createOptionUsing(function ($data) { $skill = Skill::create([ 'name' => $data['name'], ]); return $skill->id; }) ->required(); }), ])
34 replies
FFilament
Created by Woojava on 10/11/2023 in #❓┊help
Confirming you cannot add a new model during an attach?
Now, the refactor is, can this be combined into a single modal? So, right now, I have two actions: Attach and Create. I'd love to have one action that can Attach or Create a new Skill and attach? If so, is there a code snippet that displays this. If not, that's fine. Just wondering. If you have a recommended set of FilamentPHP video tutorials (I'm a visual learner) I would appreciate it. I'm already subscribed to FilamentDaily and I've watched all of the Filament v3 tutorials on YouTube, but no one is covering these items in detail. Either way, thanks for the active engagement tonight, you have helped me a ton. I am grateful.
34 replies
FFilament
Created by Woojava on 10/11/2023 in #❓┊help
Confirming you cannot add a new model during an attach?
This suggestion works. I can create a new Action button and attach a form to it to create a new skill and have that new skilled attached to the profile.
34 replies
FFilament
Created by Woojava on 10/11/2023 in #❓┊help
Confirming you cannot add a new model during an attach?
I'll try this real quick.
34 replies
FFilament
Created by Woojava on 10/11/2023 in #❓┊help
Confirming you cannot add a new model during an attach?
Not really something I could share immediately, at the moment, it would take a few to extract the files to repo.
34 replies
FFilament
Created by Woojava on 10/11/2023 in #❓┊help
Confirming you cannot add a new model during an attach?
I only created the RelationManager, so I don't know where that select was generated from. I hadn't created a Filament Resource at the time of creating the attach/detach.
34 replies
FFilament
Created by Woojava on 10/11/2023 in #❓┊help
Confirming you cannot add a new model during an attach?
Sure. Give me a moment.
34 replies
FFilament
Created by Woojava on 10/11/2023 in #❓┊help
Confirming you cannot add a new model during an attach?
Okay, give me a minute or two, thanks for the active engagement.
34 replies
FFilament
Created by Woojava on 10/11/2023 in #❓┊help
Confirming you cannot add a new model during an attach?
Yes, I think so. Being to Filament, I want to make sure I'm understanding the terms. On the ProfileResource, there is a SkillRelationManger, when you load it, it display the pivot table values of skills already attached, if any, then there's an Attach button, that opens a model with a search drop-down that I can preloading the values. You can only select a single skill at a time. I can attach a video, if that's helpful.
34 replies
FFilament
Created by Woojava on 10/11/2023 in #❓┊help
Confirming you cannot add a new model during an attach?
The documentation has been really challenging to work with so here I am with my question.
34 replies
FFilament
Created by Woojava on 10/11/2023 in #❓┊help
Confirming you cannot add a new model during an attach?
I got the attach/detach working, now, I'm trying to refactor to see if I can create an on-the-fly Skill creation.
34 replies
FFilament
Created by Woojava on 10/11/2023 in #❓┊help
Confirming you cannot add a new model during an attach?
I initially tried it via the CreateAction, but ran into lots of relationship missing errors, so I started over with just an Attach removed the CreateAction.
34 replies
FFilament
Created by Woojava on 10/11/2023 in #❓┊help
Confirming you cannot add a new model during an attach?
You can attach one or more skills to a Profile.
34 replies
FFilament
Created by Woojava on 10/11/2023 in #❓┊help
Confirming you cannot add a new model during an attach?
For what is it worth, the attach/detach is working as expected. I can skip on the fly Skill creation, but if it is possible, I'd love to implement.
34 replies
FFilament
Created by Woojava on 10/11/2023 in #❓┊help
Confirming you cannot add a new model during an attach?
Thanks for replying. I'm just trying to process your response. Being fairly new, I'm familiar with the linked to documentation if there is a select that is populated from a relationship. However, without a relationship populating the select, it's unclear to me how to add this createOptionForm on the SkillRelationManager form. At the risk of embarrassing myself, here's the code that I am work with. ---
34 replies