F
Filamentβ€’15mo ago
afatmustafa

Using the options function in SelecTree.

Hi @blackshadownl , I hope you're well. I am using the select-tree package in one of my projects, first of all thank you for the great job you did. I was able to use the "options" function in the SelectTree form component before the update but now I can't use it, I couldn't see anything in the changes in the code. How should I follow a path, I would appreciate if you can help me, thanks in advance.
SelectTree::make('category_id')
->options(app(\App\Models\MenuItemCategory::class)->getMenuItems())
->withCount()
->multiple()
->expandSelected(true)
->grouped(true)
->searchable(),
SelectTree::make('category_id')
->options(app(\App\Models\MenuItemCategory::class)->getMenuItems())
->withCount()
->multiple()
->expandSelected(true)
->grouped(true)
->searchable(),
No description
23 Replies
BlackShadow
BlackShadowβ€’15mo ago
Thank you and great to hear you are using the package. Since the big release 3.1.0 i made it only support belongsTo and belongsToMany relationships but i can take a look tomorrow perhaps to bring back the custom options. Unless you dont need it, what is it you are trying to do exactly?
afatmustafa
afatmustafaOPβ€’15mo ago
Actually my relationship is already belongsTo, the reason I use options is that you use null as the parent_id value in the query. I use -1.
BlackShadow
BlackShadowβ€’15mo ago
I see.. i could maybe make a setting perhaps Would that resolve it?
afatmustafa
afatmustafaOPβ€’15mo ago
Yes, that was actually the first solution I was looking for when I started using the package.
BlackShadow
BlackShadowβ€’15mo ago
like nullValue(-1) where null is default.
afatmustafa
afatmustafaOPβ€’15mo ago
Yes, exactly. The first thing I did was to check the parameters of the relationship function.
BlackShadow
BlackShadowβ€’15mo ago
Alright i will see if i can release that tomorrow end of day.
afatmustafa
afatmustafaOPβ€’15mo ago
Thanks a lot for your quick response and solution. You're great
BlackShadow
BlackShadowβ€’15mo ago
No problem! But first i will sleep its 23:00 squint
BlackShadow
BlackShadowβ€’15mo ago
GitHub
nullValue Β· Issue #23 Β· CodeWithDennis/filament-select-tree
Add the possibility to change the null value for the parentAttribute
afatmustafa
afatmustafaOPβ€’15mo ago
Thanks, it's 00:15 here too. Good night.
BlackShadow
BlackShadowβ€’15mo ago
@afatmustafa i made a draft https://github.com/CodeWithDennis/filament-select-tree/pull/24/files you want to take a look before i merge it πŸ™‚ ? I actually went a head and released the new version.
BlackShadow
BlackShadowβ€’15mo ago
GitHub
Release v3.1.4 Β· CodeWithDennis/filament-select-tree
What's Changed Removed unused variable by @CodeWithDennis in #22 Implemented parentNullValue by @CodeWithDennis in #24 Full Changelog: v3.1.3...v3.1.4
BlackShadow
BlackShadowβ€’15mo ago
I hope this works for you. πŸ‘
afatmustafa
afatmustafaOPβ€’15mo ago
Hi, now that I am available, you have already published it. I'll check it right away.
BlackShadow
BlackShadowβ€’15mo ago
Resolved πŸ˜› ? @afatmustafa
afatmustafa
afatmustafaOPβ€’15mo ago
I'm sorry, I was able to look at it now, I tried it now, but it gives a 500 error, it didn't write anything in the laravel.log file either.
No description
BlackShadow
BlackShadowβ€’15mo ago
wut Oh shit i made a mistake 🀑
BlackShadow
BlackShadowβ€’15mo ago
GitHub
Release v3.1.5 Β· CodeWithDennis/filament-select-tree
What's Changed Fixed an issue where tree would go into inf loop by @CodeWithDennis in #25 Full Changelog: v3.1.4...v3.1.5
BlackShadow
BlackShadowβ€’15mo ago
I released a fix Let me know if its fixed ;D
afatmustafa
afatmustafaOPβ€’15mo ago
Okay, it's working now, thanks.
BlackShadow
BlackShadowβ€’15mo ago
Nice! Don't forget the Favorite the plugin on Github so more people can find it πŸ™‚
afatmustafa
afatmustafaOPβ€’15mo ago
I already did πŸ˜†
Want results from more Discord servers?
Add your server