Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fire method has been removed from Laravel 5.8 #258

Open
mattglover11 opened this issue Sep 15, 2019 · 1 comment
Open

Fire method has been removed from Laravel 5.8 #258

mattglover11 opened this issue Sep 15, 2019 · 1 comment

Comments

@mattglover11
Copy link

Controllers need to be updated to change the "fire" method to "dispatch" to make it compatible with Laravel 5.8

https://laravel.com/docs/5.8/upgrade#events

@WouterClaes
Copy link

You can extend the facade to make it use dispatch in stead of fire.

<?php
namespace App\Facades;
use Illuminate\Support\Facades\Event as IlluminateEvent;

class Event extends IlluminateEvent
{

    public static function fire($var)
    {
        parent::dispatch($var);
    }
}

then in config/app.php you can do

// "Event" => Illuminate\Support\Facades\Event::class,
 "Event" => App\Facades\Event::class,

worked for me, but after spending 4 hours trying to make it work and adjust it to my needs I realised I needed some extra options and I could better write a forum myself.
What a waste of my time. At least I learned how to extend facades. ;-)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants