简体   繁体   中英

How Laravel auto load all provider classes from config\app.php => providers

I wonder how does laravel load all the classes which was registered in config\app.php . 在此处输入图像描述

because I am trying to same thing with another project (non laravel framework) where I need to register module class by array. like this

class Module {

        public function __construct()
        {
            $this->register();
        }

        public function register()
        {
            return [
                \Modules\Quiz::class,
                \Modules\Library::class,
                \Modules\Payment::class,
            ];
        }
    }

Providers not for loading classes. Please look up spl_autoload_register on php.net

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM