Vinny
Vinny
FFilament
Created by Vinny on 8/31/2023 in #❓┊help
Prevent select option re-rendering in SelectInput
I have considered that option. I am willing to do it if there is no straightforward way to prevent options from reloading everytime.
4 replies
FFilament
Created by Vinny on 8/25/2023 in #❓┊help
Is it possible to create a TextInput component with a prefix that is a SelectInput?
Yeah, I was thinking of doing that as well at this point. Thanks!
24 replies
FFilament
Created by Vinny on 8/25/2023 in #❓┊help
Is it possible to create a TextInput component with a prefix that is a SelectInput?
I'm open to suggestions!
24 replies
FFilament
Created by Vinny on 8/25/2023 in #❓┊help
Is it possible to create a TextInput component with a prefix that is a SelectInput?
Thanks for the help anyway!!
24 replies
FFilament
Created by Vinny on 8/25/2023 in #❓┊help
Is it possible to create a TextInput component with a prefix that is a SelectInput?
Yep, copy pasted the same exact code, same issues. Regardless though, I was hoping it would serve as just a dropdown instead of modal with a dropdown. I'll mark this as solved unless you perhaps know a way to have the button show a dropdown instead of opening a modal.
24 replies
FFilament
Created by Vinny on 8/25/2023 in #❓┊help
Is it possible to create a TextInput component with a prefix that is a SelectInput?
the rest looks similar
24 replies
FFilament
Created by Vinny on 8/25/2023 in #❓┊help
Is it possible to create a TextInput component with a prefix that is a SelectInput?
Interesting, the modal never shows up for me.
24 replies
FFilament
Created by Vinny on 8/25/2023 in #❓┊help
Is it possible to create a TextInput component with a prefix that is a SelectInput?
Would you mind passing a screenshot of how it looks for you?
24 replies
FFilament
Created by Vinny on 8/25/2023 in #❓┊help
Is it possible to create a TextInput component with a prefix that is a SelectInput?
I'm not sure if it makes a difference but this is happening inside a wizard. I'll give it another look to see if I did anything wrong.
24 replies
FFilament
Created by Vinny on 8/25/2023 in #❓┊help
Is it possible to create a TextInput component with a prefix that is a SelectInput?
I was just gonna say that I'm using use Filament\Forms\Components\Actions\Action;
24 replies
FFilament
Created by Vinny on 8/25/2023 in #❓┊help
Is it possible to create a TextInput component with a prefix that is a SelectInput?
D:
24 replies
FFilament
Created by Vinny on 8/25/2023 in #❓┊help
Is it possible to create a TextInput component with a prefix that is a SelectInput?
TextInput::make('mobile_number')
->label('Mobile Number')
->required()
->prefixAction(Action::make('country')->icon('heroicon-o-user')->form([Select::make('mobile_phone_country')->options(['test' => 'test'])]))
->tel(),
TextInput::make('mobile_number')
->label('Mobile Number')
->required()
->prefixAction(Action::make('country')->icon('heroicon-o-user')->form([Select::make('mobile_phone_country')->options(['test' => 'test'])]))
->tel(),
This does not seem to work :( Not only is an icon required (it gives me an error if i dont give it one), the select input does not show up at all.
24 replies
FFilament
Created by Vinny on 8/25/2023 in #❓┊help
Is it possible to create a TextInput component with a prefix that is a SelectInput?
!! thanks i will give it a shot
24 replies
FFilament
Created by Vinny on 8/14/2023 in #❓┊help
Table Builder + Scout: Search Result Order
Yes, sorry, I meant FIELD(). And that was indeed the recommended alternative in stack overflow :P
11 replies
FFilament
Created by Vinny on 8/14/2023 in #❓┊help
Table Builder + Scout: Search Result Order
As I mentioned above, I have some other logic in the applySearchToTableQuery() method now because I've already "hacked" around the issue. The snippet I posted for ordering is just my workaround solution. Any other resolutions are appreciated!
11 replies
FFilament
Created by Vinny on 8/14/2023 in #❓┊help
Table Builder + Scout: Search Result Order
It has evolved quite a bit since then. But I will share what I discovered. At that point I was using the exact version of applySearchToTableQuery() from the filament docs. (I am pasting the one from the docs here because the one I have now is vastly different because I have worked around the issue already. see below)
protected function applySearchToTableQuery(Builder $query): Builder
{
$this->applyColumnSearchesToTableQuery($query);

if (filled($search = $this->getTableSearch())) {
$query->whereIn('id', Post::search($search)->keys());
}

return $query;
}
protected function applySearchToTableQuery(Builder $query): Builder
{
$this->applyColumnSearchesToTableQuery($query);

if (filled($search = $this->getTableSearch())) {
$query->whereIn('id', Post::search($search)->keys());
}

return $query;
}
Essentially if I do Post::search($q)->get() I get all the results in order because (from what I gathered, I could be wrong) scout handles the reordering internally. To compare, I did Post::query()->whereIn('id', Post::search('whatever')->keys()) and the order was messed up. So, while scout does use whereIn internally like the docs say, it handles reordering based on search relevancy internally also. To work around the messed up order, I appended a manual "ORDER BY" at the end of my query in applySearchToTableQuery() to order it based on the search keys that scout returns.
$orderByCases = [];
foreach ($searchResultKeys as $key => $value) $orderByCases[] = "WHEN {$value} THEN {$key}";
$orderByCasesString = implode(" ", $orderByCases);
$query->orderByRaw("CASE ID_NUM {$orderByCasesString} END");
$query->whereIn('id_num', $searchResultKeys);
return $query;
$orderByCases = [];
foreach ($searchResultKeys as $key => $value) $orderByCases[] = "WHEN {$value} THEN {$key}";
$orderByCasesString = implode(" ", $orderByCases);
$query->orderByRaw("CASE ID_NUM {$orderByCasesString} END");
$query->whereIn('id_num', $searchResultKeys);
return $query;
In MySQL, I believe you can use FIELD() to achieve the same effect but I use SQL Server so I had to go with this approach. It's a bit dirty but I couldn't figure out any other way to preserve search relevancy as returned by meilisearch.
11 replies
FFilament
Created by Vinny on 8/8/2023 in #❓┊help
Issues with using custom JS scripts
regardless, like i said, i tried that and still the same issue as 1.
6 replies
FFilament
Created by Vinny on 8/8/2023 in #❓┊help
Issues with using custom JS scripts
its required to be able to import alpine from a JS module since alpine is bundled with livewire now.
6 replies
FFilament
Created by Vinny on 8/8/2023 in #❓┊help
Issues with using custom JS scripts
@livewireScripts is replaced by @filamentScripts but @livewireScriptConfig is something different in livewire v3
6 replies
FFilament
Created by Vinny on 8/8/2023 in #❓┊help
Issues with using custom JS scripts
I tried that too. Still the same issue as 1.
6 replies