Page 1 of 1

Der Laravel -Komplex hat eine von vielen Beziehung

Posted: 04 Mar 2025, 08:16
by Anonymous
Ich habe einen Mitarbeiter und ein Gehaltsmodell. < /p>
Ein Mitarbeiter hat viele Gehälter und ein Gehalt, das so definiert ist:

Code: Select all

    public function salary(): HasOne
{
return $this->hasOne(Salary::class)->ofMany([
'start_date' => 'max',
'id' => 'max',
], fn ($query) => $query->whereDate('start_date', '