update() public method

Update an existing setting.
public update ( array $input ) : boolean
$input array Data to update a setting
return boolean
Esempio n. 1
0
 public function test_Should_FailToUpdate_When_ValidationFails()
 {
     $this->mockValidator->shouldReceive('with')->once()->andReturn($this->mockValidator);
     $this->mockValidator->shouldReceive('passes')->once()->andReturn(false);
     $form = new MailSettingForm($this->mockValidator, $this->mockSettingRepository);
     $result = $form->update([]);
     $this->assertFalse($result, 'Expected update to fail.');
 }
Esempio 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());
     }
 }