/
home
/
techb158
/
ileadtechnology.com
/
SSM
/
app
/
Http
/
Requests
/
utility
/
/home/techb158/ileadtechnology.com/SSM/app/Http/Requests/utility
mkdir
upload
Name
Size
Mode
Actions
EmailTemplateRequest.php
1595
0644
edit
dl
rm
IpFilterRequest.php
1004
0644
edit
dl
rm
TodoRequest.php
1000
0644
edit
dl
rm
Edit:
/home/techb158/ileadtechnology.com/SSM/app/Http/Requests/utility/EmailTemplateRequest.php
(1595B)
<?php namespace App\Http\Requests\Utility; use Illuminate\Foundation\Http\FormRequest; class EmailTemplateRequest 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() { if ($this->method() === 'POST') { return [ 'name' => 'required|unique:email_templates', 'category' => 'required|in:user' ]; } elseif ($this->method() === 'PATCH') { return [ 'subject' => 'required', 'body' => 'required' ]; } } /** * Translate fields with user friendly name. * * @return array */ public function attributes() { if ($this->method() === 'POST') { return [ 'name' => trans('utility.email_template_name'), 'category' => trans('utility.email_template_category'), ]; } elseif ($this->method() === 'PATCH') { return [ 'subject' => trans('utility.email_template_subject'), 'body' => trans('utility.email_template_body'), ]; } } /** * Get the error messages for the defined validation rules. * * @return array */ public function messages() { return [ ]; } }
Save
cmd:
run