Laravel - Undefined Variable Event Dispatcher::fire() |
The error was clean as it looked
Call to undefined method Illuminate\Events\Dispatcher::fire() in Laravel 5.8But we went into the documentation over the official website and figured out that this was decided to take down on the previous version of Laravel version.
Why this happened?
fire() function is an alias of the dispatch() methodWhat needs to fix this?
Use the dispatch() method instead of fire() methodExample
Initial Code
Illuminate\Events\Dispatcher::fire()Updated Code
Illuminate\Events\Dispatcher::dispatch()Once you change the fire() method to dispatch() method that specific Undefined variable error will be gone.
Let me us know in comments if there is any issue with respect to this article.
Keep Coding and Keep Smiling :)