示例#1
0
 /**
  * Synchronize roles in the database
  */
 protected function synchronizeRoles()
 {
     $rolesConfig = Config::get('membership::database.roles');
     $roles = array();
     foreach ($rolesConfig as $type => $description) {
         $roles[] = new Role(compact('type', 'description'));
     }
     Role::matchRoles(new Collection($roles));
 }
示例#2
0
 /**
  * @return \Illuminate\Database\Eloquent\Relations\BelongsTo
  */
 public function role()
 {
     return $this->belongsTo(Role::getClass(), 'role_id');
 }
示例#3
0
 /**
  * @return \Illuminate\Database\Eloquent\Relations\BelongsToMany
  */
 public function roles()
 {
     return $this->belongsToMany(Role::getClass(), 'le_user_role', 'user_id', 'role_id');
 }