/** * Get the user that owns the invoice. */ public function user() { return $this->belongsTo(Spark::userModel(), 'user_id'); }
/** * Define the Spark route model bindings. * * @return void */ protected function defineRouteBindings() { Route::model('team', Spark::teamModel()); Route::model('team_member', Spark::userModel()); }
/** * Get all of the users that belong to the team. */ public function users() { return $this->belongsToMany(Spark::userModel(), 'team_users', 'team_id', 'user_id')->withPivot('role'); }
/** * Get the user that created the notification (if any). */ public function creator() { return $this->belongsTo(Spark::userModel(), 'created_by'); }