46 lines
1,002 B
PHP
46 lines
1,002 B
PHP
<?php
|
|
|
|
namespace App\Http\Requests\Bo\FaqQuestions;
|
|
|
|
use Illuminate\Foundation\Http\FormRequest;
|
|
|
|
class StoreFaqQuestionRequest extends FormRequest
|
|
{
|
|
/**
|
|
* Determine if the user is authorized to make this request.
|
|
*
|
|
* @return boolean
|
|
*/
|
|
public function authorize()
|
|
{
|
|
return auth()->check();
|
|
}
|
|
|
|
/**
|
|
* Get the validation rules that apply to the request.
|
|
*
|
|
* @return array
|
|
*/
|
|
public function rules()
|
|
{
|
|
return [
|
|
'question' => 'required|string|min:3|max:255',
|
|
'answer' => 'required|string|min:3|max:255',
|
|
'theme_id' => 'required|exists:faq_themes,id',
|
|
];
|
|
}
|
|
|
|
/**
|
|
* Get custom attributes for validator errors.
|
|
*
|
|
* @return array
|
|
*/
|
|
public function attributes(): array
|
|
{
|
|
return [
|
|
'question' => trans('Question'),
|
|
'answer' => trans('Réponse'),
|
|
'theme_id' => trans('Thème associé'),
|
|
];
|
|
}
|
|
}
|