public static function bootSearchable()
    {
        static::saved(function ($model) {
            if ($model->shouldSyncDocument()) {
                $model->document()->save();
            }
        });

        static::deleted(function ($model) {
            if ($model->shouldSyncDocument()) {
                $model->document()->delete();
            }
        });
    }
public static function bootSearchable()
    {
        static::saved(function ($model) {
            if ($model->shouldSyncDocument()) {
                $model->document()->save();
            }
        });

        static::deleted(function ($model) {
            if ($model->shouldSyncDocument()) {
                $model->document()->delete();
            }
        });
    }
public static function bootSearchable ( ) { static :: saved ( function ( $ model ) { if ( $ model -> shouldSyncDocument ( ) ) { $ model -> document ( ) -> save ( ) ; } } ) ; static :: deleted ( function ( $ model ) { if ( $ model -> shouldSyncDocument ( ) ) { $ model -> document ( ) -> delete ( ) ; } } ) ; }
Searchable boot model.
Searchable boot model .