F
Filamentthyk123

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
S
sandofgods39d 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'))
T
thyk12339d ago
Thank you so much for helping! You're so awesome!