How to wrire custom validation rule in controller Laravel? -
i have default validation rule in controller laravel: $validator = validator::make($request->all(), [ 'email' => 'required|email', 'phone' => 'required|numeric', 'code' => 'required|string|min:3|max:4', 'timezone' => 'required|numeric', 'country' => 'required|integer', 'agreement' => 'accepted' ]); i tried this, dont know how transfer parameters inside function: public function boot() { validator::extend('phone_unique', function($attribute, $value, $parameters) { return substr($value, 0, 3) == '+44'; }); } how can extent validation own rule? example need validate concatination of inputs: $phone = $request->code.' '.$request->phone after check if $phone exists in database i want use method: > $validator