| Current Path : /var/www/html/reddsis/app/Http/Requests/Backend/ |
| Current File : /var/www/html/reddsis/app/Http/Requests/Backend/AppTranslationRequest.php |
<?php
namespace App\Http\Requests\Backend;
use Illuminate\Foundation\Http\FormRequest;
use Illuminate\Validation\Rule;
class AppTranslationRequest extends FormRequest
{
public function authorize(): bool
{
return true;
}
public function rules(): array
{
return [
'key' => 'required|string|max:255',
'lang' => ['required', 'string', 'max:10', Rule::exists('ref', 'code')->where('cat', 'LANGUAGE')],
'value' => 'nullable|string',
];
}
public function messages(): array
{
return [
'lang.exists' => 'Language is not registered in reference table.',
];
}
}