| Total Complexity | 3 |
| Total Lines | 40 |
| Duplicated Lines | 0 % |
| Coverage | 0% |
| Changes | 0 | ||
| 1 | <?php |
||
| 20 | abstract class Application extends MongoModel implements Ownable, ApplicationAttributes |
||
| 21 | { |
||
| 22 | use OwnedByUser, ModelFactory, SoftDeletes; |
||
| 23 | |||
| 24 | /** |
||
| 25 | * @var string |
||
| 26 | */ |
||
| 27 | protected $collection = 'applications'; |
||
| 28 | |||
| 29 | /** |
||
| 30 | * @var array |
||
| 31 | */ |
||
| 32 | protected $guarded = []; |
||
| 33 | |||
| 34 | protected $casts = [ |
||
| 35 | 'active' => 'boolean', |
||
| 36 | ]; |
||
| 37 | |||
| 38 | protected $dates = [ |
||
| 39 | 'created_at', |
||
| 40 | 'updated_at', |
||
| 41 | 'deleted_at', |
||
| 42 | ]; |
||
| 43 | |||
| 44 | protected static function boot() |
||
| 45 | { |
||
| 46 | parent::boot(); |
||
| 47 | static::addGlobalScope('type', function (Builder $builder) { |
||
| 48 | $builder->where('type', get_short_class_name(static::class)); |
||
| 49 | }); |
||
| 50 | } |
||
| 51 | |||
| 52 | public function user() |
||
| 53 | { |
||
| 54 | return $this->belongsTo(User::class); |
||
| 55 | } |
||
| 56 | |||
| 57 | public function machine() |
||
| 60 | } |
||
| 61 | } |
||
| 62 |