How to get the id of a user inside the creation of a Validator in Laravel?

0
public function boot() 
{ 
   //Criação de uma nova validação 

   \Validator::extend('unique_cpf', function ($attribute, $value, 
    $parameters, $validator) { 
          $value = str_replace(['.','-'],'', $value); 
          return ((DB::table('tab_medicos') 
         ->where('med_cpf','=', $value)->where('med_id', '=', 9964) 
         ->count()) == 1); 
   }); 
} 

Instead of '9964' I want it to be the id, can anyone help me?

    
asked by anonymous 03.01.2019 / 17:04

1 answer

-1

We can get it this way, where we're getting the url:

request()->route('id');
    
04.01.2019 / 11:41