Skip to content

Instantly share code, notes, and snippets.

@emmanuelbarturen
Last active February 5, 2018 17:22
Show Gist options
  • Save emmanuelbarturen/2b1eba4bb3ade8dc80be2a3f69c13ae3 to your computer and use it in GitHub Desktop.
Save emmanuelbarturen/2b1eba4bb3ade8dc80be2a3f69c13ae3 to your computer and use it in GitHub Desktop.
available methods in form request
<?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