> */ public function rules(): array { return [ 'category_id' => ['required', 'integer', 'exists:categories,id'], 'slug' => ['required', 'string', 'max:255', Rule::unique('courses', 'slug')->ignore($this->route('course'))], 'title' => ['required', 'string', 'max:255'], 'sub' => ['nullable', 'string', 'max:255'], 'desc' => ['required', 'string'], 'long_desc' => ['required', 'string'], 'duration' => ['required', 'string', 'max:255'], 'students' => ['nullable', 'integer', 'min:0'], 'rating' => ['nullable', 'numeric', 'min:0', 'max:5'], 'badge' => ['nullable', 'string', Rule::enum(CourseBadge::class)], 'image' => ['nullable', 'string', 'max:255'], 'price' => ['nullable', 'string', 'max:255'], 'includes' => ['nullable', 'array'], 'includes.*' => ['string'], 'requirements' => ['nullable', 'array'], 'requirements.*' => ['string'], 'meta_title' => ['nullable', 'string', 'max:255'], 'meta_description' => ['nullable', 'string'], 'scope' => ['nullable', 'array'], 'scope.*' => ['string'], 'standard' => ['nullable', 'string', 'max:255'], 'language' => ['nullable', 'string', 'max:255'], 'location' => ['nullable', 'string', 'max:255'], ]; } /** * @return array */ public function messages(): array { return [ 'category_id.required' => 'Kategori seçimi zorunludur.', 'category_id.exists' => 'Seçilen kategori bulunamadı.', 'slug.required' => 'Slug alanı zorunludur.', 'slug.unique' => 'Bu slug zaten kullanılıyor.', 'title.required' => 'Eğitim başlığı zorunludur.', ]; } }