public static function boot()
    {
        parent::boot();

        static::deleting(function ($model) {
            optional($model->type)->delete();
        });

        static::saved(function ($model) {
            optional($model->repeatable)->save();
        });

        static::deleted(function ($model) {
            optional($model->repeatable)->save();
        });
    }
public static function boot()
    {
        parent::boot();

        static::deleting(function ($model) {
            optional($model->type)->delete();
        });

        static::saved(function ($model) {
            optional($model->repeatable)->save();
        });

        static::deleted(function ($model) {
            optional($model->repeatable)->save();
        });
    }
public static function boot ( ) { parent :: boot ( ) ; static :: deleting ( function ( $ model ) { optional ( $ model -> type ) -> delete ( ) ; } ) ; static :: saved ( function ( $ model ) { optional ( $ model -> repeatable ) -> save ( ) ; } ) ; static :: deleted ( function ( $ model ) { optional ( $ model -> repeatable ) -> save ( ) ; } ) ; }
Hook into model boot events to ensure scout search indexes are updated

@return void
Hook into model boot events to ensure scout search indexes are updated