Laravel 4 Model class not found

后端 未结 2 534
无人共我
无人共我 2021-02-06 05:18

I just created a simple app in Laravel 4 and when I create a model, I get an exception that it\'s not found.

// /app/models/Worker.php:


        
相关标签:
2条回答
  • 2021-02-06 06:04

    I think there are two commands to get the autoload started:

    $ composer dump-autoload  
    

    and

    $ php artisan dump-autoload
    

    Seems composer dump-autoload is to let composer create autoloads as defined in the composer.json files. And php artisan dump-autoload glues all the composer dump-autoloads ( also from vendors and workbenches ) together.

    0 讨论(0)
  • 2021-02-06 06:11

    Anytime you create a new class file in L4 run this command.

    php composer dump-autoload
    
    0 讨论(0)
提交回复
热议问题