Laravel引用自定义php文件

直接引用

1
require __DIR__ . '/../common/util.function.php';

autoload

composer.json

1
2
3
4
5
6
7
8
9
10
"autoload": {
"psr-4": {
"App\\": "app/"
},
"classmap": [
"database/seeds",
"database/factories",
"app/Library"
]
},
1
> composer dump-autoload  //重新加载类库

Powered by AppBlog.CN     浙ICP备14037229号

Copyright © 2012 - 2020 APP开发技术博客 All Rights Reserved.

访客数 : | 访问量 :