1# add custom attribute for validation errors laravel 8
2$rules = [
3 'account_number' => ['required','digits:10','max:10','unique:bank_details']
4];
5$messages = [];
6$attributes = [
7 'account_number' => 'Mobile number',
8];
9$request->validate($rules,$messages,$attributes);
10// OR
11$validator = Validator::make($request->all(), $rules, $messages, $attributes);