authentikate/app/Models/Invitation.php
Javier Feliz 1fd6f03a81
Some checks failed
linter / quality (push) Successful in 3m13s
tests / ci (push) Failing after 7m37s
Started working on invites
2025-08-01 20:59:42 -04:00

25 lines
454 B
PHP

<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Model;
class Invitation extends Model
{
protected $guarded = ['id'];
protected $casts = [
'expires_at' => 'datetime',
'accepted_at' => 'datetime'
];
public function status(): string
{
return !empty($this->accepted_at) ? 'accepted' : 'pending';
}
public function isPending(): bool
{
return empty($this->accepted_at);
}
}