<commit_before><?php 
namespace App\Http\Controllers; 
use Illuminate\Http\Request;
 use App\Exceptions\Handler;
  use Validator; use GeoIP;

   class IpController extends Controller { 
   	public function Check(Request $request){ 
   		$validator = Validator::make($request->all(),[ 
   			'ip'->'ip' 
   			]); 
   	
   		if($validator->fails()){ 
   			throw new \Symfony\Component\HttpKernel\Exception\BadRequestExeption(); 
   		} 

   		$ip = $request->ip; 
   		$location = GeoIP::getLocation("$ip"); 

   		return $location; 
   	} 
   }<commit_msg>IPAPI-7: Validation<commit_after><?php 
namespace App\Http\Controllers; 
use Illuminate\Http\Request;
 use App\Exceptions\Handler;
  use Validator; use GeoIP;

   class IpController extends Controller { 
   	public function Check(Request $request){ 
   		$validator = Validator::make($request->all(),[ 
   			'ip'=>'required|ip'  
   			]); 

   		if($validator->fails()){ 
   			throw new \Symfony\Component\HttpKernel\Exception\BadRequestExeption(); 
   		} 

   		$location = GeoIP::getLocation($request->ip); 

   		return $location; 
   	} 
   }
{'fraction_non_alphanumeric': 0.14001806684733514, 'fraction_numerical': 0.0009033423667570009, 'mean_word_length': 3.073529411764706, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 11, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1993457', 'n_tokens_mistral': 405, 'n_tokens_neox': 376, 'n_words': 63}