ReflectionException: Class ClassName does not exist - Laravel

后端 未结 22 1287
无人共我
无人共我 2020-11-29 04:39

As soon, I am typing php artisan db:seed command.

I\'m getting Error Like:

[ReflectionException]
Clas

22条回答
  •  情书的邮戳
    2020-11-29 04:56

    I have the same problem with a class. I tried composer dump-autoload and php artisan config:clear but it did not solve my problem.

    Then I decided to read my code to find the problem and I found the problem. The problem in my case was a missing comma in my class. See my Model code:

    {
        protected
        $fillable = ['agente_id', 'matter_id', 'amendment_id', 'tipo_id'];
    
        public
        $rules = [
            'agente_id' => 'required', // <= See the comma
            'tipo_id' => 'required'
        ];
    
        public
        $niceNames = [
            'agente_id' => 'Membro', // <= This comma is missing on my code
            'tipo_id' => 'Membro'
        ];
    }
    

提交回复
热议问题