Illuminate\Database\Eloquent\Model::reguard PHP Method

reguard() public static method

Enable the mass assignment restrictions.
public static reguard ( ) : void
return void
    public static function reguard()
    {
        static::$unguarded = false;
    }

Usage Example

 /**
  * Run the database seeds.
  *
  * @return void
  */
 public function run()
 {
     Model::unguard();
     // DB::table('students')->delete();
     $this->call(StudentsSeeder::class);
     Model::reguard();
 }
All Usage Examples Of Illuminate\Database\Eloquent\Model::reguard
Model