Last active
February 5, 2018 17:22
-
-
Save emmanuelbarturen/2b1eba4bb3ade8dc80be2a3f69c13ae3 to your computer and use it in GitHub Desktop.
available methods in form request
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php namespace App\Http\Requests\Admin; | |
use Illuminate\Foundation\Http\FormRequest; | |
class UpdateBoosterFormRequest extends FormRequest | |
{ | |
protected $errorBag = 'edit'; | |
/** | |
* Determine if the user is authorized to make this request. | |
* | |
* @return bool | |
*/ | |
public function authorize() | |
{ | |
return auth()->check(); | |
} | |
/** | |
* Get the validation rules that apply to the request. | |
* | |
* @return array | |
*/ | |
public function rules() | |
{ | |
return [ | |
'nickname' => 'different:summoner', | |
]; | |
} | |
/** | |
* @return string | |
*/ | |
protected function getRedirectUrl() | |
{ | |
$booster = $this->route('booster'); | |
return route('admin.boosters.show', [$booster, 'show' => 'edit']); | |
} | |
/** | |
* @return array | |
*/ | |
public function messages() | |
{ | |
return [ | |
'is_physical.required_without' => 'Debe escoger al menos un tipo', | |
'is_virtual.required_without' => 'Debe escoger al menos un tipo' | |
]; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment