Skip to content

Commit 420a1ed

Browse files
committed
Remove attribute parameter from error message
Laravel takes care of this automatically.
1 parent cc04950 commit 420a1ed

File tree

2 files changed

+3
-5
lines changed

2 files changed

+3
-5
lines changed

src/UniqueTranslationRule.php

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -85,9 +85,7 @@ public function passes($attribute, $value)
8585
*/
8686
public function message()
8787
{
88-
return trans('validation.unique', [
89-
'attribute' => $this->attribute,
90-
]);
88+
return trans('validation.unique');
9189
}
9290

9391
/**

tests/UniqueTranslationTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -193,8 +193,8 @@ public function it_returns_the_correct_error_message()
193193
$errors = session('errors');
194194
$returnedSlugError = $errors->first('form_slug');
195195
$returnedNameError = $errors->first('form_name');
196-
$expectedSlugError = trans('validation.unique', ['attribute' => 'form_slug']);
197-
$expectedNameError = trans('validation.unique', ['attribute' => 'form_name']);
196+
$expectedSlugError = trans('validation.unique', ['attribute' => 'form slug']);
197+
$expectedNameError = trans('validation.unique', ['attribute' => 'form name']);
198198

199199
$this->assertNotEmpty($returnedSlugError);
200200
$this->assertNotEmpty($returnedNameError);

0 commit comments

Comments
 (0)