T
T
Tweak_stack2016-07-13 15:50:26
Laravel
Tweak_stack, 2016-07-13 15:50:26

How to get latest value from database fields?

$table_last_id = Company::where('id')->get();
How to extract last value from id fields and write to variable?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
I
Ilya, 2016-07-13
@Tweak_stack

Usual option:
Using Eloquent:
$table_last_id = Company::max('id');

S
Stanislav Pochepko, 2016-07-13
@DJZT

laravel.su/docs/5.0/queries#aggregates

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question