

The PHP craftsman does not suddenly work
source link: https://www.codesd.com/item/the-php-craftsman-does-not-suddenly-work.html
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.

The PHP craftsman does not suddenly work
I have started to learn Laravel. Until now, everything worked perfectly. I'm following this tutorial and I'm stuck with episode 7.
The problem is that I cannot start artisan anymore. I have tried to install tinker, and I've probably updated artisan so I ended up without artisan and tinker. I am using Linux Ubuntu 12.04 LTS. I have installed everything via command line. After that I tried to run:
php artisan --version
The following problem occurs:
[ErrorException]
Declaration of App\Providers\EventServiceProvider::boot() should be compati ble with Illuminate\Foundation\Support\Providers\EventServiceProvider::boot
()
This is how my file app/Providers/EventServiceProvider.php
looks like:
<?php
namespace App\Providers;
use Illuminate\Contracts\Events\Dispatcher as DispatcherContract;
use Illuminate\Foundation\Support\Providers\EventServiceProvider as ServiceProvider;
class EventServiceProvider extends ServiceProvider
{
/**
* The event listener mappings for the application.
*
* @var array
*/
protected $listen = [
'App\Events\SomeEvent' => [
'App\Listeners\EventListener',
],
];
/**
* Register any other events for your application.
*
* @param \Illuminate\Contracts\Events\Dispatcher $events
* @return void
*/
public function boot(DispatcherContract $events)
{
parent::boot($events);
//
}
}
I'm using Laravel 5.2 and my composer.json it looks like this:
"php": ">=5.5.9",
"laravel/framework": "5.2.*",
"doctrine/dbal": "^2.6@dev",
"vluzrmos/tinker": "dev-master",
"moon/artisan": "dev-master"
I've seen similar problems here for example:
https://laracasts.com/discuss/channels/laravel/event-service-provider-in-package
but never the answer was given directly and actually I do not understand how to solve this problem? I would need direct answer because I'm newbie in Laravel. Can artisan be updated somehow easy with Linux command line so it can work again?
Apparently, the new boot()
method doesn't take any argument. You'll have to apply some changes to the three providers.
/**
* Register any other events for your application.
*
- * @param \Illuminate\Contracts\Events\Dispatcher $events
* @return void
*/
- public function boot(DispatcherContract $events)
+ public function boot()
{
- parent::boot($events);
+ parent::boot();
//
}
Check out this commit for the full list of changes.
https://github.com/laravel/laravel/commit/2b05ce3b054593f7622c1be6c4c6aadc1c5a54ae
Recommend
-
24
Laravel Craftsman is a CLI for easily crafting Laravel assets for any project (artisan make on steroids) by Mike Erickson . This project relies onLaravel Zero, providing a...
-
32
README.md Laravel Craftsman Description Laravel Craftsman (written using the awesome Laravel-Zero C...
-
6
Craftsman, Craftswoman, Craftsperson 02 May 2018 In the past I have used the term “Craftswoman” only when refering directly to a woman. In most other cases, including most gender neutral cases, I have used the ter...
-
6
The Laborer and the Craftsman 30 January 2013 In a recent blog Ted Neward made this remarkable statement: ...
-
8
Death of a Craftsman Posted: April 5, 2020 | Author: Einar | Filed under: Uncategorized
-
22
PHP CURL does not work - WAMP on Windows 7 64-bit advertisements I got my WAMP installed on m...
-
9
数据结构与算法(十三)——红黑树1 红黑树是一种自平衡的排序二叉树,常用于关联数组、字典,在各种语言的底层实现中被广泛应用,Java 的 T...
-
5
Iframe does not work in PHP? advertisements This question already has an answer here: Echo inside an element a...
-
3
Clean Architecture: A Craftsman's Guide to Software Structure and Design George Aristy on Dec 28, 20212021-12-28T00:00:00-05:00 Jan 12022-01-01T14:55:48-05:00 11 min
-
6
How do you attain the mindset of a great coder? Reading these five books will give you a great start.Software Craftmanship Requires Reading the Right Books
About Joyk
Aggregate valuable and interesting links.
Joyk means Joy of geeK