I am trying to override the laravel eloquent model constants for created_at and updated_at:
namespace App;
use Illuminate\Database\Eloquent\Model;
class Visit extends Model
{
const CREATED_AT = 'creation_date';
const UPDATED_AT = 'last_update';
}
and then get the latest entry:
dd(Visit::latest()->get());
but am getting an unknown column error:
"SQLSTATE[42S22]: Column not found: 1054 Unknown column 'created_at' in
'order clause' (SQL: select * from `visits` order by `created_at` desc)"
Is there anything else that needs to be done to get this working?