'array', 'is_active' => 'boolean', 'is_default' => 'boolean', ]; /** * Boot the model. */ protected static function boot() { parent::boot(); // Ensure only one template is active at a time static::saving(function ($template) { if ($template->is_active) { static::where('id', '!=', $template->id) ->update(['is_active' => false]); } }); } // protected static function newFactory(): MarksheetTemplateFactory // { // // return MarksheetTemplateFactory::new(); // } }