Level 1
This package is trash, not maintained and has plenty of bugs, better get rid of it and never plan on using it for a long term.
Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.
Hi! I'm trying to filter 2 columns by date in livewire-powergrid which are dateStart and dateEnd. Since makeInputDatePicker() only filters 1 column by date range, I tried concatenating the two columns. In the views, it shows the proper data but makeInputDatePicker is not working.
It shows this error. SQLSTATE[42S22]: Column not found: 1054 Unknown column 'employmentPeriod_formatted' in 'where clause'
This is my code:
public function datasource(): Builder
{
return EmploymentData::query()
->selectRaw(", CONCAT('employment_data.dateJobStart','employment_data.dateJobEnd') as employmentPeriod")
->leftjoin('personal_data','employment_data.IDNumber', '=','personal_data.IDNumber')
->select('employment_data.', 'personal_data.firstName as firstName', 'personal_data.middleName
as middleName','personal_data.lastName as lastName') ;
}
public function addColumns(): PowerGridEloquent
{
->addColumn('employmentPeriod_formatted',function (EmploymentData $model) {
return $model->dateJobStart . ' - ' . $model->dateJobEnd;
});
}
public function columns(): array
{
return [
Column::make('EMPLOYMENT PERIOD','employmentPeriod_formatted')
->sortable()
->searchable()
->makeInputdatePicker('employmentPeriod_formatted'),
];
}
Please or to participate in this conversation.