A
A
Aibek Zhaksybaev2017-09-04 13:27:42
Laravel
Aibek Zhaksybaev, 2017-09-04 13:27:42

How to create widget in laravel?

Hello everyone, for about 3 days I have been studying laravel for the first two days I read the documentation on the third day I started creating a blog, everything went fine until I needed to move the right panel of the site to a separate file where the output of the latest articles and categories is stored, I used to write on yii2 there such a problem was solved with the help of widgets in laravel there are none, what to do? I tried using ViewComposer but I don't know how to pass queries like $categories = Category::all();
constantly throws an error $categories call to undefined Thanks in advance everyone!

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Alexander Aksentiev, 2017-09-04
@sosis04ka

https://laravel.com/docs/5.5/views#sharing-data-wi...

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question