Ejemplo n.º 1
0
 /**
  * Get used scopes in current inspection
  *
  * @return array
  */
 public function getScopeListAttribute()
 {
     $scopes = (int) $this->attributes['scopes'];
     foreach (SubScope::all() as $subScope) {
         if (($scopes & $subScope->code) > 0) {
             $scopeList[] = $subScope->scope->category;
         }
     }
     return collect(array_unique($scopeList));
 }
Ejemplo n.º 2
0
 /**
  * Test Relationship SubScope with Scope
  *
  * @return void
  */
 public function testRelationshipWithScope()
 {
     $subScope = new SubScope();
     $this->assertInstanceOf(BelongsTo::class, $subScope->scope());
 }