且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

Laravel 5:找不到库类

更新时间:2022-06-24 19:29:14

首先,您应该为此TermExtractor

"require": {
"robholmes/term-extractor" : "3.*"
}

内部文件app.php中,您需要做2件事(类似这样,不知道别名和提供者的正确名称(一定要在执行composer update之前先做)

Inside file app.php you need to do 2 things (something like this, dunno the proper name of alias and provider (be sure to do composer update before doing it)

首先添加提供商

'providers' => [
term-extractor/TermExtractorProvider::class
]

第二个添加别名

'aliases' => [
'TermExtractor' => term-extractor\TermExtractor\Facades\TermExtractor::class,
]

这应该为您提供别名TermExtractor,您可以在整个应用程序中使用该别名,而无需每次执行require public_path() . '/term-extractor/src/TermExtractor/TermExtractor.php';

That should give you alias TermExtractor which u can use in whole app without each time do require public_path() . '/term-extractor/src/TermExtractor/TermExtractor.php';

希望有帮助