49 lines
833 B
PHP
49 lines
833 B
PHP
|
|
<?php
|
||
|
|
|
||
|
|
namespace App\Models\Api;
|
||
|
|
|
||
|
|
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||
|
|
use Illuminate\Database\Eloquent\Model;
|
||
|
|
|
||
|
|
class ApiTokenStat extends Model
|
||
|
|
{
|
||
|
|
use HasFactory;
|
||
|
|
|
||
|
|
/**
|
||
|
|
* The attributes that are mass assignable.
|
||
|
|
*
|
||
|
|
* @var string[]
|
||
|
|
*/
|
||
|
|
protected $fillable = ['date'];
|
||
|
|
|
||
|
|
/**
|
||
|
|
* The attributes that should be cast.
|
||
|
|
*
|
||
|
|
* @var array
|
||
|
|
*/
|
||
|
|
protected $casts = [
|
||
|
|
'date' => 'date'
|
||
|
|
];
|
||
|
|
|
||
|
|
/**
|
||
|
|
* The model's attributes.
|
||
|
|
*
|
||
|
|
* @var array
|
||
|
|
*/
|
||
|
|
protected $attributes = [
|
||
|
|
'nb_calls' => 0
|
||
|
|
];
|
||
|
|
|
||
|
|
// * RELATIONSHIPS
|
||
|
|
|
||
|
|
/**
|
||
|
|
* BelongsTo apiToken relation
|
||
|
|
*
|
||
|
|
* @return \Illuminate\Database\Eloquent\Relations\BelongsTo
|
||
|
|
*/
|
||
|
|
public function apiToken()
|
||
|
|
{
|
||
|
|
return $this->belongsTo(ApiToken::class);
|
||
|
|
}
|
||
|
|
}
|