<?php
 namespace App\Http\Requests; use Illuminate\Foundation\Http\FormRequest; class LanguageRequest extends FormRequest { public function authorize(): bool { return true; } public function rules(): array { $rules = [ 'native_name' => 'required|string|max:255', 'status' => 'required|boolean', 'site_default' => 'sometimes|boolean', 'admin_default' => 'sometimes|boolean', ]; return $rules; } public function attributes(): array { return [ 'native_name' => __('admin/languages.fields_native_name'), 'status' => __('admin/languages.fields_status'), 'site_default' => __('admin/languages.fields_site_default'), 'admin_default' => __('admin/languages.fields_admin_default'), ]; } public function messages(): array { return [ 'native_name.required' => __('validation.required', ['attribute' => __('admin/languages.fields_native_name')]), 'status.required' => __('validation.required', ['attribute' => __('admin/languages.fields_status')]), 'status.boolean' => __('validation.boolean', ['attribute' => __('admin/languages.fields_status')]), 'site_default.boolean' => __('validation.boolean', ['attribute' => __('admin/languages.fields_site_default')]), 'admin_default.boolean' => __('validation.boolean', ['attribute' => __('admin/languages.fields_admin_default')]), ]; } } 