laravel fetch max value
snippet in php

laravel fetch max value

user2771

Cliente::max('id')
  
  or
  
$maxValue = Cliente::orderBy('id', 'desc')->value('id'); // gets only the id