You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

54 lines
1.1 KiB
PHP

<?php
namespace App\Http\Requests;
use Illuminate\Contracts\Validation\Validator;
use Illuminate\Foundation\Http\FormRequest;
use Yo;
class EditProfitsharingsInput extends FormRequest
{
/**
* Determine if the user is authorized to make this request.
*
* @return bool
*/
public function authorize()
{
return true;
}
/**
* Get the validation rules that apply to the request.
*
* @return array
*/
public function rules()
{
return [
'account' => ['required', 'between:1,50'],
'name' => ['required', 'between:1,50'],
'formula' => ['required', 'between:1,200'],
'desc' => ['between:0,80'],
];
}
public function messages()
{
return [
'account.required' => 200082,
'account.between' => 200083,
'name.required' => 200087,
'name.between' => 200088,
'formula.required' => 200084,
'formula.between' => 200085,
'desc.between' => 200086,
];
}
public function failedValidation(Validator $validator)
{
Yo::error_echo($validator->errors()->first());
}
}