54 lines
1.5 KiB
PHP
54 lines
1.5 KiB
PHP
<?php
|
|
|
|
namespace App\Http\Requests\Bo\Prizes;
|
|
|
|
use Illuminate\Foundation\Http\FormRequest;
|
|
|
|
class StorePrizeRequest extends FormRequest
|
|
{
|
|
/**
|
|
* Determine if the user is authorized to make this request.
|
|
*
|
|
* @return boolean
|
|
*/
|
|
public function authorize()
|
|
{
|
|
return auth('backend')->check();
|
|
}
|
|
|
|
/**
|
|
* Get the validation rules that apply to the request.
|
|
*
|
|
* @return array
|
|
*/
|
|
public function rules()
|
|
{
|
|
return [
|
|
'label_one' => 'required|string|min:3|max:255',
|
|
'label_many' => 'required|string|min:3|max:255',
|
|
'arg_title' => 'required|string|min:3|max:255',
|
|
'arg_subtitle' => 'required|string|min:3|max:255',
|
|
'arg_content' => 'required|string|min:15',
|
|
'quantity' => 'required|numeric|min:1',
|
|
'pdf_winning_proof' => 'nullable|file|mimes:pdf',
|
|
];
|
|
}
|
|
|
|
/**
|
|
* Get custom attributes for validator errors.
|
|
*
|
|
* @return array
|
|
*/
|
|
public function attributes(): array
|
|
{
|
|
return [
|
|
'label_one' => trans('validation.custom.label_one'),
|
|
'label_many' => trans('validation.custom.label_many'),
|
|
'arg_title' => trans('validation.attributes.title'),
|
|
'arg_subtitle' => trans('validation.custom.subtitle'),
|
|
'arg_content' => trans('validation.attributes.content'),
|
|
'quantity' => trans('validation.custom.quantity'),
|
|
'pdf_winning_proof' => trans('validation.custom.pdf_winning_proof'),
|
|
];
|
|
}
|
|
}
|