Bristol SU Support Package
ModuleInstancePermission.php
Go to the documentation of this file.
1 <?php
2 
4 
10 
14 class ModuleInstancePermission extends Model
15 {
16  use HasRevisions;
17 
23  protected $fillable = [
24  'logic_id', 'ability', 'module_instance_id'
25  ];
26 
35  protected $appends = ['type', 'permission'];
36 
42  public function moduleInstance()
43  {
44  return $this->belongsTo(ModuleInstance::class);
45  }
46 
52  public function logic()
53  {
54  return $this->belongsTo(Logic::class);
55  }
56 
62  public function getPermissionAttribute()
63  {
64  return app(PermissionRepository::class)->get($this->ability);
65  }
66 
72  public function getTypeAttribute()
73  {
74  return $this->permission->getType();
75  }
76 
77 }