laravel where get first and last record code example Example: laravel get last record Model::latest()->first();