How to connect your non-laravel classes for use in the controller? This may be a set of classes, or even just functions. In general, an analogue of require_once is needed not to write everything in the controller, but not to inherit classes from the Model, like this:

namespace App; use Illuminate\Database\Eloquent\Model; class Code extends Model { } 

    1 answer 1

    This is implemented through the service provider http://laravel.su/docs/5.0/providers (more correctly)

    ====

    And you can (clumsily):

    Copy the file we need with the class and the necessary functions in the app folder

    Suppose app / Code.php, add the file to the namespace App; (before class description)

    We register in the aliases section our class

     'Code' => \App\Code::class, 

    Now in the controller:

     $Code = new Code; $Code::метод $Code->метод