Exemplo n.º 1
0
 /**
  * Get all of the teams that the user belongs to.
  */
 public function teams()
 {
     return $this->belongsToMany(Spark::teamModel(), 'team_users', 'user_id', 'team_id')->withPivot(['role'])->orderBy('name', 'asc');
 }
Exemplo n.º 2
0
 /**
  * Get the team that owns the invitation.
  */
 public function team()
 {
     return $this->belongsTo(Spark::teamModel(), 'team_id');
 }
Exemplo n.º 3
0
 /**
  * Define the Spark route model bindings.
  *
  * @return void
  */
 protected function defineRouteBindings()
 {
     Route::model('team', Spark::teamModel());
     Route::model('team_member', Spark::userModel());
 }