InvitationCreated::class, 'deleted' => InvitationDeleted::class, 'restored' => InvitationRestored::class, 'updated' => InvitationUpdated::class, ]; /** * The table associated with the model. * * @var string */ protected $table = Invitation::TABLE; /** * The primary key associated with the table. * * @var string */ protected $primaryKey = Invitation::ATTRIBUTE_ID; /** * The attributes that should be cast. * * @var array */ protected $casts = [ Invitation::ATTRIBUTE_STATUS => InvitationStatus::class, ]; /** * Get name. * * @return string */ public function getName(): string { return $this->name; } /** * Is invitation open? * * @return bool */ public function isOpen(): bool { return $this->status->is(InvitationStatus::OPEN); } }