Page MenuHomePhorge

IP4Net.php
No OneTemporary

Authored By
Unknown
Size
737 B
Referenced Files
None
Subscribers
None

IP4Net.php

<?php
namespace App;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Support\Facades\DB;
class IP4Net extends Model
{
protected $table = "ip4nets";
/** @var array<int, string> The attributes that are mass assignable */
protected $fillable = [
'rir_name',
'net_number',
'net_mask',
'net_broadcast',
'country',
'serial',
'created_at',
'updated_at'
];
public static function getNet($ip)
{
$where = 'INET_ATON(net_number) <= INET_ATON(?) and INET_ATON(net_broadcast) >= INET_ATON(?)';
return IP4Net::whereRaw($where, [$ip, $ip])
->orderByRaw('INET_ATON(net_number), net_mask DESC')
->first();
}
}

File Metadata

Mime Type
text/x-php
Expires
Fri, Apr 24, 11:14 AM (1 w, 5 d ago)
Storage Engine
local-disk
Storage Format
Raw Data
Storage Handle
50/ce/38e838215c3c512c5dd7c391234b
Default Alt Text
IP4Net.php (737 B)

Event Timeline