Did you restart the command line tinker after generating the class? In case tinker is already open when you change code it won't take affect until you exit and tinker again.
Also, check namespaces and a little composer dump-autoload never hurts :)
Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.
I'm following this tutorial: https://laracasts.com/series/laravel-5-fundamentals/episodes/8 If you go to Time: 2:15 I can successfully enter tinker and execture some basic php to test that it is working. But when I try the same code Jeffrey is saying, it's giving me this error
$article = new App\Article; PHP Fatal error: Class 'App\Article' not found in eval()'d code on line 1
I was able to generate the Article.php file in the previous step in the video. Any idea what I'm doing wrong?
Did you restart the command line tinker after generating the class? In case tinker is already open when you change code it won't take affect until you exit and tinker again.
Also, check namespaces and a little composer dump-autoload never hurts :)
Please or to participate in this conversation.