mirror of
https://github.com/Bigherollc/wticreatorstudio.git
synced 2026-07-15 02:07:56 -04:00
50 lines
1.4 KiB
PHP
50 lines
1.4 KiB
PHP
<?php
|
|
|
|
namespace Modules\FrontendCMS\Http\Requests;
|
|
|
|
use Illuminate\Foundation\Http\FormRequest;
|
|
|
|
class UpdateSubscribeContentRequest extends FormRequest
|
|
{
|
|
|
|
public function rules()
|
|
{
|
|
|
|
if (isModuleActive('FrontendMultiLang')) {
|
|
$code = auth()->user()->lang_code;
|
|
return [
|
|
'title.'. $code => 'nullable|max:255',
|
|
'subtitle.'. $code => 'nullable|max:255',
|
|
'description.'. $code => 'nullable',
|
|
'file' => 'nullable|mimes:jpeg,jpg,png,webp,bmp'
|
|
];
|
|
}else{
|
|
return [
|
|
'title' => 'nullable|max:255',
|
|
'subtitle' => 'nullable|max:255',
|
|
'description' => 'nullable',
|
|
'file' => 'nullable|mimes:jpeg,jpg,png,webp,bmp'
|
|
];
|
|
}
|
|
}
|
|
public function messages()
|
|
{
|
|
if (isModuleActive('FrontendMultiLang')) {
|
|
return [
|
|
'title.*.max' => 'The title max length must be 255 words',
|
|
'subtitle.*.max' => 'The subtitle max length must be 255 words',
|
|
];
|
|
}else{
|
|
return [
|
|
'title.max' => 'The title max length must be 255 words',
|
|
'subtitle.max' => 'The subtitle max length must be 255 words',
|
|
];
|
|
}
|
|
}
|
|
|
|
public function authorize()
|
|
{
|
|
return true;
|
|
}
|
|
}
|