/** * 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'); }
/** * Get the team that owns the invitation. */ public function team() { return $this->belongsTo(Spark::teamModel(), 'team_id'); }
/** * Define the Spark route model bindings. * * @return void */ protected function defineRouteBindings() { Route::model('team', Spark::teamModel()); Route::model('team_member', Spark::userModel()); }