| 12345678910111213141516171819202122232425262728293031 |
- <?php
- namespace Spatie\EloquentSortable\Test;
- use Illuminate\Database\Eloquent\Builder;
- use Illuminate\Database\Eloquent\Model;
- use Spatie\EloquentSortable\Sortable;
- use Spatie\EloquentSortable\SortableTrait;
- class DummyWithGlobalScope extends Model implements Sortable
- {
- use SortableTrait;
- protected $table = 'dummies';
- protected $guarded = [];
- public $timestamps = false;
- /**
- * The "booting" method of the model.
- *
- * @return void
- */
- protected static function boot()
- {
- parent::boot();
- parent::addGlobalScope('ActiveScope', function (Builder $builder) {
- $builder->where('is_active', true);
- });
- }
- }
|