Spârky
Spârky
FFilament
Created by Spârky on 3/28/2024 in #❓┊help
Mutate pivot data on parent creation
Wow! Thanks a lot 🙂 I'm multitasking on a different project right now but I'll be sure to check this ASAP, thanks again and I'm marking this as closed
7 replies
FFilament
Created by Spârky on 3/28/2024 in #❓┊help
Mutate pivot data on parent creation
After searching the docs, I found this part : https://filamentphp.com/docs/3.x/panels/resources/creating-records#lifecycle-hooks Do you think I should use afterCreate?
7 replies
FFilament
Created by Spârky on 3/28/2024 in #❓┊help
Mutate pivot data on parent creation
Anyone?
7 replies
FFilament
Created by Spârky on 6/20/2023 in #❓┊help
Using html() on a RichEditor-set value still rendering the tags
Update: I found a way to resolve the issue Putting html() AFTER limit() does work, but doesn't if placed before
9 replies
FFilament
Created by Spârky on 6/20/2023 in #❓┊help
Using html() on a RichEditor-set value still rendering the tags
Well, I ran composer update, cleared cache, restarted server etc. but no effect
9 replies
FFilament
Created by Spârky on 6/20/2023 in #❓┊help
Using html() on a RichEditor-set value still rendering the tags
Huh, the problem was present on my intern's project, I just pulled it on my computer and I don't have the issue I'll check his machine
9 replies
FFilament
Created by Spârky on 6/20/2023 in #❓┊help
Using html() on a RichEditor-set value still rendering the tags
Yes, when I enter plain text in the Rich Editor, I get the <p> tag in the table
9 replies
FFilament
Created by Spârky on 6/20/2023 in #❓┊help
Using html() on a RichEditor-set value still rendering the tags
9 replies
FFilament
Created by Spârky on 6/16/2023 in #❓┊help
Is it possible to prevent user to put end time earlier than start time with TimePickers ?
Thanks a lot! I managed to make my things work thanks to your code 🙂 Marking this as resolved
3 replies
FFilament
Created by bwurtz999 on 4/13/2023 in #❓┊help
Use $get to find repeater value
Hello! I hope you are doing well 🙂 Thank you so much, this is exactly what I was looking for and it is working 🥲
20 replies
FFilament
Created by bwurtz999 on 4/13/2023 in #❓┊help
Use $get to find repeater value
Oh okay, I tried to do something with the state but couldn't make it work I'll be on a vacation until Monday but I'll keep you updated. Thanks anyway! 🙂
20 replies
FFilament
Created by bwurtz999 on 4/13/2023 in #❓┊help
Use $get to find repeater value
Ok, I almost made it work Now when I pick an option, this option is not available for other instances but it also removes it from the input 😦 Here is the code :
Forms\Components\Repeater::make('product_menu')
->label("Produits du menu")
->schema([
Forms\Components\Select::make('product_id')
->label('Produit')
->required()
->options(function (callable $get){
$repeater = $get('../../product_menu');
$idIsAlreadyUsed = [];
$repeater_uuid = array_key_first($repeater);
if (isset($repeater[$repeater_uuid])){
foreach ($repeater as $section){
if (in_array($section['product_id'], $idIsAlreadyUsed) === false){
$idIsAlreadyUsed[] = $section['product_id'];
}
}
}
return Product::whereNotIn('id', array_filter($idIsAlreadyUsed, fn ($value) => !is_null($value)))->pluck('name','id')->toArray();
}),
Forms\Components\Repeater::make('product_menu')
->label("Produits du menu")
->schema([
Forms\Components\Select::make('product_id')
->label('Produit')
->required()
->options(function (callable $get){
$repeater = $get('../../product_menu');
$idIsAlreadyUsed = [];
$repeater_uuid = array_key_first($repeater);
if (isset($repeater[$repeater_uuid])){
foreach ($repeater as $section){
if (in_array($section['product_id'], $idIsAlreadyUsed) === false){
$idIsAlreadyUsed[] = $section['product_id'];
}
}
}
return Product::whereNotIn('id', array_filter($idIsAlreadyUsed, fn ($value) => !is_null($value)))->pluck('name','id')->toArray();
}),
20 replies
FFilament
Created by bwurtz999 on 4/13/2023 in #❓┊help
Use $get to find repeater value
Yes I noticed that, when I var_dump my repeater, I get a uuid but it changes every refresh Any idea?
20 replies
FFilament
Created by bwurtz999 on 4/13/2023 in #❓┊help
Use $get to find repeater value
Good morning 🙂 I tried to adapt your code to my problem but it seems like the condition
if(isset($repeater[0]))
if(isset($repeater[0]))
is never fulfilled so I still have all the options. Are you sure this is all the code you have?
20 replies
FFilament
Created by bwurtz999 on 4/13/2023 in #❓┊help
Use $get to find repeater value
I'll try this tomorrow! Thanks for the quick response 🙂
20 replies
FFilament
Created by bwurtz999 on 4/13/2023 in #❓┊help
Use $get to find repeater value
Hello! Sorry for digging up the thread, did you find a way to make it work ? @bwurtz999
20 replies
FFilament
Created by Spârky on 3/31/2023 in #❓┊help
Make a graph to count records by month and year
3 replies