<?php

class GeoIp extends Eloquent{
    protected $table = 'geoip';
    public $timestamps = false;

    public static function getCountry($ip)
    {
        $ip_num = sprintf("%u",ip2long($ip));
dd($ip);
        return self::whereRaw($ip_num." between begin_ip_num and end_ip_num")->first();
    }
}