select row with max value laravel code example
Example 1: laravel select max value
Client::max('id')
Example 2: laravel fetch max value
Cliente::max('id')
or
$maxValue = Cliente::orderBy('id', 'desc')->value('id'); // gets only the id
Client::max('id')
Cliente::max('id')
or
$maxValue = Cliente::orderBy('id', 'desc')->value('id'); // gets only the id