* #38 - wip * #38 - wip * #38 - fix * #38 - fix * #38 - fix * #38 - fix * Update resources/lang/pl.json Co-authored-by: Krzysztof Rewak <krzysztof.rewak@blumilk.pl> * #38 - cr fix Co-authored-by: EwelinaLasowy <ewelina.lasowy@blumilk.pl> Co-authored-by: Krzysztof Rewak <krzysztof.rewak@blumilk.pl>
This commit is contained in:
@@ -58,6 +58,11 @@ class User extends Authenticatable
|
||||
return $this->hasMany(VacationRequest::class);
|
||||
}
|
||||
|
||||
public function createdVacationRequests(): HasMany
|
||||
{
|
||||
return $this->hasMany(VacationRequest::class, "creator_id");
|
||||
}
|
||||
|
||||
public function vacations(): HasMany
|
||||
{
|
||||
return $this->hasMany(Vacation::class);
|
||||
|
@@ -22,7 +22,9 @@ use Toby\Domain\Enums\VacationType;
|
||||
* @property Carbon $from
|
||||
* @property Carbon $to
|
||||
* @property string $comment
|
||||
* @property bool $flow_skipped
|
||||
* @property User $user
|
||||
* @property User $creator
|
||||
* @property YearPeriod $yearPeriod
|
||||
* @property Collection $activities
|
||||
* @property Collection $vacations
|
||||
@@ -47,6 +49,11 @@ class VacationRequest extends Model
|
||||
return $this->belongsTo(User::class);
|
||||
}
|
||||
|
||||
public function creator(): BelongsTo
|
||||
{
|
||||
return $this->belongsTo(User::class, "creator_id");
|
||||
}
|
||||
|
||||
public function yearPeriod(): BelongsTo
|
||||
{
|
||||
return $this->belongsTo(YearPeriod::class);
|
||||
@@ -69,6 +76,11 @@ class VacationRequest extends Model
|
||||
$this->save();
|
||||
}
|
||||
|
||||
public function hasFlowSkipped(): bool
|
||||
{
|
||||
return $this->flow_skipped;
|
||||
}
|
||||
|
||||
public function scopeStates(Builder $query, array $states): Builder
|
||||
{
|
||||
return $query->whereIn("state", $states);
|
||||
|
Reference in New Issue
Block a user