F
Filament10mo ago
thyk123

What query to select from date now and see between 2 column

What query to select from date now and see between 2 column, like i want to check is today still more than startDate and less than dueDate, if still in that period of time, get the data of it and add it to select option
Solution:
you want to get options for a select input, based on a query? If yes you can use the ->->options like that: ``` use Filament\Forms\Components\Select;...
Jump to solution
2 Replies
Solution
sandofgods
sandofgods10mo ago
you want to get options for a select input, based on a query? If yes you can use the ->->options like that:
use Filament\Forms\Components\Select;

Select::make('tasks_name')
->label('Task to do')
->options(Tasks::where([
['colum_start_date','<',$now],
['column_due_date','>',$now]
])->get()->pluck('option_colum_to_select', 'id'))
use Filament\Forms\Components\Select;

Select::make('tasks_name')
->label('Task to do')
->options(Tasks::where([
['colum_start_date','<',$now],
['column_due_date','>',$now]
])->get()->pluck('option_colum_to_select', 'id'))
thyk123
thyk123OP10mo ago
Thank you so much for helping! You're so awesome!
Want results from more Discord servers?
Add your server