示例#1
0
 /**
  * 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());
 }
示例#3
0
 /**
  * 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');
 }
示例#4
0
 /**
  * Get the user that created the notification (if any).
  */
 public function creator()
 {
     return $this->belongsTo(Spark::userModel(), 'created_by');
 }