I have a table in the database, novidades
, where I have a column named date
is to be stored as string in dd-mm-yyyy
format, but I would like to sort by date based on this value , I calculate that you have to convert to date/datetime
at select time.
What I'm trying to do now is nothing more than this:
Novidade::orderBy('date', 'DESC')->get();
However it does not work, the sorting goes wrong understandably.
NOTE : I can not move the table and change the column type.