Ejemplo n.º 1
0
 public function handle(ProviderProvider $providerProvider, AclContract $acl)
 {
     $selfClient = Client::where(['name' => 'Provider Hub'])->first();
     if (empty($selfClient)) {
         $selfClient = new Client();
         $selfClient->name = 'Provider Hub';
         $selfClient->secret = 'foobar';
         $selfClient->type = 'provider_hub';
         $selfClient->save();
     }
     \dump(['provider hub', 'client_id' => $selfClient->id, 'client_secret' => 'foobar']);
     \dump(['role setup', $acl->setupRoles()]);
     $provider = $providerProvider->find(['name' => 'Test Provider', 'slug' => 'test']);
     if (empty($provider)) {
         $provider = $providerProvider->create(['name' => 'Test Provider', 'slug' => 'test']);
     }
     \dump(['provider', 'id' => $provider->id, 'slug' => $provider->slug]);
 }
Ejemplo n.º 2
0
 /**
  * Add role
  * @param string  $role
  * @return object (self)
  */
 public function add($role)
 {
     $this->bucket[$role] = sprintf("%05d", $this->acl->getRoleLevel($role)) . '-' . $role;
     return $this;
 }