Page Menu
Home
Phorge
Search
Configure Global Search
Log In
Files
F120827619
IP4Net.php
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Authored By
Unknown
Size
737 B
Referenced Files
None
Subscribers
None
IP4Net.php
View Options
<?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
Details
Attached
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)
Attached To
Mode
rK kolab
Attached
Detach File
Event Timeline