简体   繁体   中英

Laravel 5 - Change Models,Views,Controllers path

i have edited psr-4 on composer.json

"autoload": {
    "classmap": [
        "database"
    ],
    "psr-4": {
        "Marka\\Urun\\": "vendor/Marka/Urun/src/",
        "App\\": "app/"

    },
    "files": [
        "vendor/Marka/Urun/src/helpers.php"
    ]
},

I want to change file(routes.php, helpers.php and Models,Views,Controllers) pathes to : Vendor/Marka/Urun/

在此处输入图片说明

How can I do it ?

You're trying to get some modular structure if I get it right.

If so, instead of trying to set a different namespacing from composer for each of your modules under vendor directory; i think you may try to use something like http://sky.pingpong-labs.com/docs/2.0/modules

Otherwise as you may know, by using PSR-4 and directory structure, if you coded your files properly all necessary files would be loaded automatically as you named (namespaced) them.

By the way, just in case you didn't know you may also need a ServiceProvider to boot everything up for Laravel on your package.

I also suggest you to read https://laravel.com/docs/5.2/packages if you need any help about development structure/functionality.

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