Loading…

In Laravel, what is Guarded Attribute in a Model ?

It is the reverse of fillable. When a guarded specifies which fields are not mass assignable.

Example

                                        

class User extends Model {
protected $guarded = ['user_type'];
}

Suggest An Answer

No suggestions avaliable!

Latest post from Laravel Interview Questions

Ask Question