R
R
Roquefort2018-05-22 17:04:10
Laravel
Roquefort, 2018-05-22 17:04:10

Where to get data for controllers?

How to correctly place a function that goes to api for data? After receiving the data, they are needed in different controllers. Now it's just a trait that I include in every class. and have a function $this->getData();

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Alexander Aksentiev, 2018-05-22
@Sanasol

https://laravel.com/docs/5.6/providers
https://laravel.com/docs/5.6/facades
well, or anywhere else "outside" the main thing is to register autoload in the composer and connect through use.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question