Hi, if Event is your model, then:
$ php artisan tinker
>>> App\Event::all();
Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.
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
All your models are there, but as I said above you are using an Event class that exists in the framework as well.
If you open your config/app.php in the aliases array you will see this:
'Event' => Illuminate\Support\Facades\Event::class,
So either chose a different name, or make sure you always use the correct import.
Please or to participate in this conversation.