tuckQ's avatar
Level 1

How can I solve an error, "PHP Fatal error: Undefined constant App\Task in eval()'d code on line 1" ?

This is question is regarding a video tutorial "Laravel 5.4 From Scratch: Eloquent 101" on LARACASTS. -> https://laracasts.com/series/laravel-from-scratch-2017/episodes/7

When I run "App\Task" in tinker mode as the tutorial says, I come up with an error "PHP Fatal error: Undefined constant App\Task in eval()'d code on line 1".

How can I solve this error?

0 likes
2 replies
tuckQ's avatar
Level 1

Thank you tomi for your advice.

I just solved the error.

The cause of the error was that App\Task was not a complete command. I changed it to App\Task::all(); , and then get a prompt successfully.

Please or to participate in this conversation.