1
我試圖寫一個插件,使用插件創建composer.json的文件夾中調用未定義的方法[包裝]
{
"Require": {
"Php": "> = 5.4.0",
"Mattbrown/laracurl": "2.0.0"
}
}
放plugin.php
public function boot()
{
App :: register ('\ Mattbrown \ Laracurl \ LaracurlServiceProvider');
}
但當你調用任何頁面接下來發生的攔截
Call to undefined method [package]
*****/Vendor/laravel/framework/src/Illuminate/Support/ ServiceProvider.php line 226
# Called Code Document Line
14 Illuminate\Support\ServiceProvider->__call(…) ~/plugins/triagmas/parser/vendor/mattbrown/laracurl/src/Mattbrown/Laracurl/LaracurlServiceProvider.php 21
13 Mattbrown\Laracurl\LaracurlServiceProvider->package(…) ~/plugins/triagmas/parser/vendor/mattbrown/laracurl/src/Mattbrown/Laracurl/LaracurlServiceProvider.php 21
12 Mattbrown\Laracurl\LaracurlServiceProvider->boot()
11 call_user_func_array(…) ~/vendor/laravel/framework/src/Illuminate/Container/Container.php 523
10 Illuminate\Container\Container->call(…) ~/vendor/laravel/framework/src/Illuminate/Foundation/Application.php 703
9 Illuminate\Foundation\Application->bootProvider(…) ~/vendor/laravel/framework/src/Illuminate/Foundation/Application.php 685
8 Illuminate\Foundation\Application->Illuminate\Foundation\{closure}(…)
7 array_walk(…) ~/vendor/laravel/framework/src/Illuminate/Foundation/Application.php 686
6 Illuminate\Foundation\Application->boot() ~/vendor/laravel/framework/src/Illuminate/Foundation/Bootstrap/BootProviders.php 15
5 Illuminate\Foundation\Bootstrap\BootProviders->bootstrap(…) ~/vendor/laravel/framework/src/Illuminate/Foundation/Application.php 181
4 Illuminate\Foundation\Application->bootstrapWith(…) ~/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php 199
3 Illuminate\Foundation\Http\Kernel->bootstrap() ~/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php 110
2 Illuminate\Foundation\Http\Kernel->sendRequestThroughRouter(…) ~/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php 84
1 Illuminate\Foundation\Http\Kernel->handle(…) ~/index.php
請告訴我該怎麼做我的錯誤
看起來不像你的錯。 Laracurl似乎與Laravel 5不兼容,因爲它使用'package',它在[Laravel 5](https://github.com/laravel/framework/commit/3a0afc20f25ad3bed640ff1a14957f972d123cf7)中被刪除。 –
非常感謝。 –
非常感謝。我沒有啓動方法改變數據包。 –