Bas
Bas

Reputation: 2400

Laravel 5 translate validation attribute

How can i translate the attribute, now the output is: companyname is verplicht. (dutch)

Validation.php

'required'             => ':attribute is verplicht.',

Controller:

$rules = array(
    'companyname'       => 'required'
;

View:

{{ Form::text( 'companyname' , null, array( 'class' => 'form-control' ) ) ) }}

Upvotes: 11

Views: 10454

Answers (1)

Diego Vidal
Diego Vidal

Reputation: 1057

You need to edit the app/resources/lang/your-language/validation.php and at the bottom you will see an attribute array.

Following your example just add:

'attributes' => [
'companyname' => 'Your Custom Name'
],

Hope this helps!

Upvotes: 30

Related Questions