This commit is contained in:
Adrian Hopek
2022-03-29 15:13:10 +02:00
parent 93f0151b14
commit 3c43f6814d
28 changed files with 176 additions and 144 deletions

View File

@@ -7,7 +7,6 @@ namespace Toby\Eloquent\Observers;
use Illuminate\Contracts\Hashing\Hasher;
use Illuminate\Support\Str;
use Toby\Eloquent\Models\User;
use Toby\Eloquent\Models\YearPeriod;
class UserObserver
{
@@ -23,15 +22,4 @@ class UserObserver
*/
$user->password = $this->hash->make(Str::random(40));
}
public function created(User $user): void
{
$yearPeriods = YearPeriod::all();
foreach ($yearPeriods as $yearPeriod) {
$user->vacationLimits()->create([
"year_period_id" => $yearPeriod->id,
]);
}
}
}