added Orte-Table
This commit is contained in:
@@ -10,7 +10,7 @@ class Veranstaltung extends Model
|
||||
|
||||
protected $fillable = ['name','beginn','ende','geaste','hinweise'];
|
||||
|
||||
protected $dates = ['beginn', 'ende'];
|
||||
protected $dates = ['beginn', 'ende', 'created_at', 'updated_at'];
|
||||
|
||||
public function eintragungen(){
|
||||
return $this->hasMany('App\Eintragung');
|
||||
@@ -19,4 +19,10 @@ class Veranstaltung extends Model
|
||||
public function einteilungen(){
|
||||
return $this->hasMany('App\Einteilung');
|
||||
}
|
||||
|
||||
public function getIstEingetragenAttribute(){
|
||||
$amI = $this->eintragungen->count('user_id', "=", \Auth::id());
|
||||
|
||||
return $amI > 0;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user