feat: Phase 2 - page CRUD, subscriber management, user management
This commit is contained in:
@@ -74,6 +74,7 @@ class PreregistrationPage extends Model
|
||||
public function isActive(): bool
|
||||
{
|
||||
$now = Carbon::now();
|
||||
|
||||
return $now->gte($this->start_date) && $now->lte($this->end_date);
|
||||
}
|
||||
|
||||
@@ -86,4 +87,20 @@ class PreregistrationPage extends Model
|
||||
{
|
||||
return $query->where('is_active', true);
|
||||
}
|
||||
|
||||
/**
|
||||
* Lifecycle label for admin tables: before registration opens, open window, or after end.
|
||||
*/
|
||||
public function statusKey(): string
|
||||
{
|
||||
if ($this->isBeforeStart()) {
|
||||
return 'before_start';
|
||||
}
|
||||
|
||||
if ($this->isExpired()) {
|
||||
return 'expired';
|
||||
}
|
||||
|
||||
return 'active';
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user