在安装过程的第4步中,尝试运行 Artisan 迁移时出现错误(如下):
四处挖掘,我发现了 Laracasts 论坛上的讨论,其中指出这可能与 Laravel 5 的新结构有关。
有人对此有任何想法吗?
exception 'BadMethodCallException' with message 'Call to undefined method [package]' in /home/vagrant/myApplication/vendor/laravel/framework/src/Illuminate/Support/ServiceProvider.php:226
Stack trace:
#0 /home/vagrant/myApplication/vendor/liebig/cron/src/Liebig/Cron/CronServiceProvider.php(22): Illuminate\Support\ServiceProvider->__call('package', Array)
#1 /home/vagrant/myApplication/vendor/liebig/cron/src/Liebig/Cron/CronServiceProvider.php(22): Liebig\Cron\CronServiceProvider->package('liebig/cron')
#2 [internal function]: Liebig\Cron\CronServiceProvider->boot()
#3 /home/vagrant/myApplication/vendor/laravel/framework/src/Illuminate/Container/Container.php(523): call_user_func_array(Array, Array)
#4 /home/vagrant/myApplication/vendor/laravel/framework/src/Illuminate/Foundation/Application.php(631): Illuminate\Container\Container->call(Array)
#5 /home/vagrant/myApplication/vendor/laravel/framework/src/Illuminate/Foundation/Application.php(613): Illuminate\Foundation\Application->bootProvider(Object(Liebig\Cron\CronServiceProvider))
#6 [internal function]: Illuminate\Foundation\Application->Illuminate\Foundation\{closure}(Object(Liebig\Cron\CronServiceProvider), 19)
#7 /home/vagrant/myApplication/vendor/laravel/framework/src/Illuminate/Foundation/Application.php(614): array_walk(Array, Object(Closure))
#8 /home/vagrant/myApplication/vendor/laravel/framework/src/Illuminate/Foundation/Bootstrap/BootProviders.php(15): Illuminate\Foundation\Application->boot()
#9 /home/vagrant/myApplication/vendor/laravel/framework/src/Illuminate/Foundation/Application.php(165): Illuminate\Foundation\Bootstrap\BootProviders->bootstrap(Object(Illuminate\Foundation\Application))
#10 /home/vagrant/myApplication/vendor/laravel/framework/src/Illuminate/Foundation/Console/Kernel.php(192): Illuminate\Foundation\Application->bootstrapWith(Array)
#11 /home/vagrant/myApplication/vendor/laravel/framework/src/Illuminate/Foundation/Console/Kernel.php(89): Illuminate\Foundation\Console\Kernel->bootstrap()
#12 /home/vagrant/myApplication/artisan(36): Illuminate\Foundation\Console\Kernel->handle(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#13 {main}
Laravel 5 不需要这个包。
从一开始就内置了安排 crons 的能力。
$schedule->command('foo')->daily();