47 lines
886 B
PHP
47 lines
886 B
PHP
<?php
|
|
|
|
namespace App\Http\Requests;
|
|
|
|
use Illuminate\Foundation\Http\FormRequest;
|
|
|
|
class StoreContactUsReplyRequest 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 [
|
|
'subject' => 'required',
|
|
'reply' => 'required',
|
|
'contact_us_id' => 'required',
|
|
];
|
|
}
|
|
|
|
public function messages()
|
|
{
|
|
return [
|
|
'required' => 'The :attribute field is required.',
|
|
];
|
|
}
|
|
|
|
public function validated()
|
|
{
|
|
return array_merge(parent::validated(), [
|
|
'sent_by' => auth()->user()->id,
|
|
]);
|
|
}
|
|
}
|