You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
### se requiere una tabla con una columna llamada codigo - Tipo Varchar o String Laravel.
// Generar codigo máximo
$max_code = LogisticCost::select(
DB::raw(' (IFNULL(MAX(RIGHT(code,7)),0)) AS number_max')
)->withTrashed()->first(); //se agrega withTrashed para obligar contar registros eliminados con softdeletes. Si no siempre retornara un codigo menor contando solo softdeletes null