[Symfony\Component\Debug\Exception\FatalThrowableError] Class 'Model' not found
Does anyone know why my laravel makes a mistake when I try to make the seed?
Only when this command gives me the error
Model :: unguard ();
When I remove that command, it works for me.


It's because you're assigning data that hasn't been set in the $fillable array on your model(s).
The unguard method "bypasses" the mass assignment protection level and the reguard does the inverse.
Make sure you set the fillable fields on your models or set guarded to an empty array.
class MyModel extends Model
{
protected $fillable = ['my', 'fillable', 'fields'];
// or
protected $guarded = [];
}
Also make sure you're importing your models too.
i dont understand your answer.. where i create tis model? i need create the model and after write in all of mmy code?
until now i have been work whitout this command 'Model::unguard' and 'Model::reguard'.
Will this decision affect my entire project?
Please or to participate in this conversation.