Yes, it uses the composer autoloader like regular laravel
Note though if you change laravel code, you have to restart tinker so it knows.
Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.
General question: I am aware of that if I write php artisan tinker, and then type $faker = Faker\Factory::create(); I can access the methods in that class. However, how does tinker know exectly which class to find just by typing Faker\Factory. Do namespace have something to do with this, how is the class found? In other words, how does tinker find these classes?
It basically loads laravel into memory, and can use whatever is available to laravel. That's why if you make code changes, you need to restart tinker so it can pick up on the changes. It only knows what's available at the time php artisan tinker is called and it launches.
Please or to participate in this conversation.