how to take the last element that have the same id laravel code example Example: eloquent using last() Model::latest()->first();