コード例 #1
0
 /**
  * Customize the roles that may be assigned to team members.
  *
  * @return void
  */
 protected function customizeRoles()
 {
     Spark::defaultRole('member');
     Spark::roles(['admin' => 'Administrator', 'member' => 'Member']);
 }
コード例 #2
0
ファイル: CanJoinTeams.php プロジェクト: ibourgeois/spark
 /**
  * Join the team with the given ID.
  *
  * @param  int  $teamId
  * @return void
  */
 public function joinTeamById($teamId)
 {
     $this->teams()->attach([$teamId], ['role' => Spark::defaultRole()]);
     $this->currentTeam();
     event(new JoinedTeam($this, $this->teams()->find($teamId)));
 }