ldc-gen-game-web/app/Models/BannedIp.php
noah.lancien 218a3a7891 phpstan
2024-01-31 09:03:18 +00:00

56 lines
1.1 KiB
PHP

<?php
namespace App\Models;
use App\Casts\Ip;
use App\Traits\Models\IsCachedAsCollection;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
/**
* BannedIp.
*
* @property integer $ip IP.
*/
class BannedIp extends Model
{
use IsCachedAsCollection;
use HasFactory;
/**
* Indicates if the model should be timestamped.
*
* @var boolean
*/
public $timestamps = false;
/**
* The attributes that are mass assignable.
*
* @var array<string>
*/
protected $fillable = ['ip'];
/**
* The attributes that should be cast.
*
* @var array<string, string>
*/
protected $casts = [
'ip' => Ip::class
];
// * EVENTS
/**
* Perform any actions required after the model boots.
*
* @return void
*/
protected static function booted()
{
static::created(fn () => self::removeCached());
static::updated(fn () => self::removeCached());
static::deleted(fn () => self::removeCached());
}
}