thedevdojo / chatter

Chatter is a Simple Laravel Forum Package
https://devdojo.com/forums
MIT License
897 stars 295 forks source link

Fire method has been removed from Laravel 5.8 #258

Open mattglover11 opened 4 years ago

mattglover11 commented 4 years ago

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 commented 4 years ago

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. ;-)