38 lines
651 B
PHP
38 lines
651 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'
|
|
];
|
|
|
|
protected $casts = [
|
|
'https' => 'boolean',
|
|
'port' => 'integer',
|
|
'score' => 'integer'
|
|
];
|
|
|
|
public function getGeolocationAttribute()
|
|
{
|
|
return [
|
|
'country' => $this->country,
|
|
'city' => $this->city
|
|
];
|
|
}
|
|
}
|