A
A
Alexander2016-07-11 20:51:12
Laravel
Alexander, 2016-07-11 20:51:12

How to get single row from db in laravel5 model?

I have a table in the database with one single row (website meta-information)
how to get this single row in the model?
you can all()
and then output it in a loop, but I don’t really like
it, how to write a query correctly if there is only one row in the table?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Alexander Aksentiev, 2016-07-11
@alexmixaylov

->first()

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question