Files

40 lines
717 B
PHP

<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Factories\HasFactory;
class Proxy extends Model
{
use HasFactory;
protected $fillable = [
'proxy',
'protocol',
'ip',
'port',
'https',
'anonymity',
'score',
'country',
'city',
'last_tested_at'
];
protected $casts = [
'https' => 'boolean',
'port' => 'integer',
'score' => 'integer',
'last_tested_at' => 'datetime'
];
public function getGeolocationAttribute()
{
return [
'country' => $this->country,
'city' => $this->city
];
}
}