How to sort a custom column in Laravel with DataTables if column name does not exists in database?

Viewed 23

I have a DataTable with some columns like customer_name, brand_name that exist in the database.

But the forecast_days column is a custom made column that does not exist in the database. Now if I use a query and orderBy with column name forecast_days it gives me error "column name forecast_days does not exists".

How can I solve this issue?

0 Answers
Related