One way to achieve this is by using the attributes() method in your form request class.
In your form request class, you can override the attributes() method and return an array of custom attribute names and their corresponding validation rules.
Here's an example:
namespace App\Http\Requests;
use Illuminate\Foundation\Http\FormRequest;
class YourFormRequest extends FormRequest
{
public function attributes()
{
return [
'password' => 'Please input minimum of 8 chars',
];
}
// rest of your form request code...
}
Then, in your blade template, you can access the custom attribute names using the getAttribute() method on the form request instance.
Here's an example of how you can display the custom attribute name as a placeholder in an input field:
<input type="text" name="password" placeholder="{{ $request->getAttribute('password') }}">
Make sure to replace YourFormRequest with the actual name of your form request class.
This way, you can define custom attribute names for each input field and display them as placeholders or anywhere else you need in your blade templates.