mirror of
https://gitlab.linphone.org/BC/public/flexisip-account-manager.git
synced 2026-01-17 18:08:06 +00:00
Add routes, model and controller for AuthToken Create auth_tokens table Allow auth_token to be used for provisioning Reorganize the API Update the dependencies
24 lines
480 B
PHP
24 lines
480 B
PHP
<?php
|
|
|
|
namespace App;
|
|
|
|
use Carbon\Carbon;
|
|
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
|
use Illuminate\Database\Eloquent\Model;
|
|
|
|
class AuthToken extends Model
|
|
{
|
|
use HasFactory;
|
|
|
|
public static $expirationMinutes = 5;
|
|
|
|
public function account()
|
|
{
|
|
return $this->belongsTo('App\Account');
|
|
}
|
|
|
|
public function scopeValid($query)
|
|
{
|
|
return $query->where('created_at', '>', Carbon::now()->subMinutes(self::$expirationMinutes));
|
|
}
|
|
}
|