mirror of
https://gitlab.linphone.org/BC/public/flexisip-account-manager.git
synced 2026-01-17 10:08:05 +00:00
- Run all the migrations in the MySQL database - Add foreign keys + cascade support - Remove the AccountDeleting event (now useless) - Simplify the related code - Keep (for now), the FlexiSIP structure to ensure compatibility - Update the README - Update the test suite
27 lines
494 B
PHP
27 lines
494 B
PHP
<?php
|
|
|
|
namespace App;
|
|
|
|
use Carbon\Carbon;
|
|
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
|
use Illuminate\Database\Eloquent\Model;
|
|
|
|
class ActivationExpiration extends Model
|
|
{
|
|
use HasFactory;
|
|
|
|
protected $casts = [
|
|
'expires' => 'datetime:Y-m-d H:i:s',
|
|
];
|
|
|
|
public function account()
|
|
{
|
|
return $this->belongsTo('App\Account');
|
|
}
|
|
|
|
public function isExpired()
|
|
{
|
|
$now = Carbon::now();
|
|
return $this->expires->lessThan($now);
|
|
}
|
|
}
|