R
R
Roman Volkov2016-02-14 18:35:15
Laravel
Roman Volkov, 2016-02-14 18:35:15

How to use models in layout Laravel 5.2?

I have a Menus model where menu items are stored. In the main application template, I try to call Menus::fierst() or Menus::all(), I get a message that the Menus class was not found. How can one use Active Record in layout laravel 5.2?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
S
Stanislav Pochepko, 2016-02-14
@white_wolf_17

Must be specified along with the namespace. For example \App\Menus::first()

I
IceJOKER, 2016-02-14
@IceJOKER

Did you forget about namespaces?

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question