Arnas42
4 months ago
963
7
Laravel

PHP Error: Call to undefined method Illuminate/Events/Dispatcher::all()

Posted 4 months ago by Arnas42

Hi, I'm new to laravel, it's great, but I just ran into the problem that I cannot seem to find any answers for. While trying to use tinker I get an error when I try to look up all the objects in events model, like so:

Event::all();

I get the error: PHP Error: Call to undefined method Illuminate/Events/Dispatcher::all() in my_path Version/vendor/laravel/framework/src/Illuminate/Support/Facades/Facade.php on line 261

Athough every other model seems to work fine, I get all the objects from other tables and I create them in the same and only way I know. For example:

    $event = new Event();
    $event->date_from = $request->post('date_from');
    $event->date_to = $request->post('date_to');
    $event->place = $request->post('place');
    $event->name = $request->post('name');
    $event->description = $request->post('description');

    $event->save();

So if I type Objects::all(); it works just fine

Please sign in or create an account to participate in this conversation.