how to get max between records according to specific column value in laravel code example
Example: laravel fetch max value
Cliente::max('id')
or
$maxValue = Cliente::orderBy('id', 'desc')->value('id'); // gets only the id
Cliente::max('id')
or
$maxValue = Cliente::orderBy('id', 'desc')->value('id'); // gets only the id