Skip to content

Commit

Permalink
Add strike and suspend events
Browse files Browse the repository at this point in the history
  • Loading branch information
cholladay0816 committed Dec 27, 2023
1 parent 0e4c0c8 commit 5851a2e
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions app/Models/Suspension.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

namespace App\Models;

use App\Events\SuspensionCreated;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;

Expand All @@ -28,4 +29,11 @@ public function getExpiredAttribute(): bool
{
return $this->expired();
}

public static function booted()
{
static::created(function ($suspension) {
SuspensionCreated::dispatch($suspension);
});
}
}

0 comments on commit 5851a2e

Please sign in to comment.