V
V
vism2017-03-13 23:30:54
Laravel
vism, 2017-03-13 23:30:54

Where to put a file with a set of methods in laravel?

You need to make a component, let's say so in one file.
It will have a set of methods for working both in cron and through controllers.
Where to put this file, in what folder and from what to inherit.
In yii2 it would be a component, it would be in the components folder.

Answer the question

In order to leave comments, you need to log in

3 answer(s)
A
Afatar, 2017-03-14
@Afatar

It doesn't matter where the file is stored. You can create a new folder and put what you need there. The main namespace is correct to register.

A
Alexander Aksentiev, 2017-03-13
@Sanasol

https://laracasts.com/discuss/channels/general-dis...

I
Ivan Kondratiev, 2017-03-14
@inik23

Afatar wrote in principle correctly. You can get any framework feature almost anywhere. And it is not necessary to inherit something from something like yii.
There is an app helper here https://laravel.com/docs/5.4/container , native facades

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question