2023-03-28 14:37:49 +00:00
|
|
|
<?php
|
|
|
|
|
|
|
|
|
|
namespace App\Models;
|
|
|
|
|
|
|
|
|
|
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
|
|
|
|
use Illuminate\Database\Eloquent\Model;
|
|
|
|
|
|
|
|
|
|
class UrlStats extends Model
|
|
|
|
|
{
|
|
|
|
|
use HasFactory;
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* The attributes that are mass assignable.
|
|
|
|
|
*
|
2026-02-12 16:09:21 +01:00
|
|
|
* @var list<string>
|
2023-03-28 14:37:49 +00:00
|
|
|
*/
|
|
|
|
|
protected $fillable = [
|
|
|
|
|
'calls',
|
2025-02-05 16:53:19 +01:00
|
|
|
'date',
|
2026-06-18 10:59:44 +02:00
|
|
|
'url_key',
|
|
|
|
|
'url',
|
2023-03-28 14:37:49 +00:00
|
|
|
];
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* The attributes that should be cast.
|
|
|
|
|
*
|
|
|
|
|
* @var array<string, string>
|
|
|
|
|
*/
|
|
|
|
|
protected $casts = [
|
|
|
|
|
'date' => 'date',
|
|
|
|
|
];
|
|
|
|
|
|
2025-02-05 16:53:19 +01:00
|
|
|
/**
|
|
|
|
|
* Perform any actions required after the model boots.
|
|
|
|
|
*
|
|
|
|
|
* @return void
|
|
|
|
|
*/
|
|
|
|
|
protected static function booted(): void
|
|
|
|
|
{
|
|
|
|
|
static::creating(function (self $model) {
|
|
|
|
|
$model->calls = 1;
|
|
|
|
|
$model->date = now();
|
|
|
|
|
});
|
|
|
|
|
}
|
2023-03-28 14:37:49 +00:00
|
|
|
}
|