errors() public method

Return validation errors.
public errors ( ) : array
return array
Exemplo n.º 1
0
 public function test_Should_GetValidationErrors()
 {
     $this->mockValidator->shouldReceive('errors')->once()->andReturn(new Illuminate\Support\MessageBag());
     $form = new MailSettingForm($this->mockValidator, $this->mockSettingRepository);
     $result = $form->errors();
     $this->assertEmpty($result);
 }
Exemplo n.º 2
0
 public function postEmail(Request $request, MailSettingForm $mailSettingForm)
 {
     $input = $request->all();
     if ($mailSettingForm->update($input)) {
         return redirect()->route('settings.email');
     } else {
         return redirect()->route('settings.email')->withInput()->withErrors($mailSettingForm->errors());
     }
 }