How to use laravel mass assignment Fillable or Guarded
Here I will give you a simple example of Laravel mass assignment. Using models is one of the best facts in Laravel. Guarded is the reverse of fillable.
What is Fillable?
Using models is one of the best facts in Laravel, it has three variables, and one of them is fillable.You can define fields that can be created/ filled by mass-assignment by use of fillable.
Example :
protected $hidden = ['password'];
protected $fillable = ['f_name','l_name','email'];
What is Guarded?
Guarded is the reverse of fillable. On the off chance that usable determines that fields to be mass allowed, protected indicates that fields don’t appear to be mass assignable.
Example :
protected $guarded = ['*'];