update deploy
This commit is contained in:
48
app/Http/Requests/Announcement/StoreAnnouncementRequest.php
Normal file
48
app/Http/Requests/Announcement/StoreAnnouncementRequest.php
Normal file
@@ -0,0 +1,48 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Requests\Announcement;
|
||||
|
||||
use App\Enums\AnnouncementCategory;
|
||||
use Illuminate\Foundation\Http\FormRequest;
|
||||
use Illuminate\Validation\Rule;
|
||||
|
||||
class StoreAnnouncementRequest extends FormRequest
|
||||
{
|
||||
public function authorize(): bool
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return array<string, array<int, mixed>>
|
||||
*/
|
||||
public function rules(): array
|
||||
{
|
||||
return [
|
||||
'slug' => ['required', 'string', 'max:255', 'unique:announcements,slug'],
|
||||
'title' => ['required', 'string', 'max:255'],
|
||||
'category' => ['required', 'string', Rule::enum(AnnouncementCategory::class)],
|
||||
'excerpt' => ['nullable', 'string', 'max:500'],
|
||||
'content' => ['required', 'string'],
|
||||
'image' => ['nullable', 'string', 'max:255'],
|
||||
'is_featured' => ['sometimes', 'boolean'],
|
||||
'meta_title' => ['nullable', 'string', 'max:255'],
|
||||
'meta_description' => ['nullable', 'string', 'max:255'],
|
||||
'published_at' => ['nullable', 'date'],
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
* @return array<string, string>
|
||||
*/
|
||||
public function messages(): array
|
||||
{
|
||||
return [
|
||||
'slug.required' => 'URL slug alanı zorunludur.',
|
||||
'slug.unique' => 'Bu slug zaten kullanılıyor.',
|
||||
'title.required' => 'Başlık zorunludur.',
|
||||
'category.required' => 'Kategori zorunludur.',
|
||||
'content.required' => 'İçerik zorunludur.',
|
||||
];
|
||||
}
|
||||
}
|
||||
44
app/Http/Requests/Announcement/UpdateAnnouncementRequest.php
Normal file
44
app/Http/Requests/Announcement/UpdateAnnouncementRequest.php
Normal file
@@ -0,0 +1,44 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Requests\Announcement;
|
||||
|
||||
use App\Enums\AnnouncementCategory;
|
||||
use Illuminate\Foundation\Http\FormRequest;
|
||||
use Illuminate\Validation\Rule;
|
||||
|
||||
class UpdateAnnouncementRequest extends FormRequest
|
||||
{
|
||||
public function authorize(): bool
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return array<string, array<int, mixed>>
|
||||
*/
|
||||
public function rules(): array
|
||||
{
|
||||
return [
|
||||
'slug' => ['sometimes', 'string', 'max:255', Rule::unique('announcements', 'slug')->ignore($this->route('announcement'))],
|
||||
'title' => ['sometimes', 'string', 'max:255'],
|
||||
'category' => ['sometimes', 'string', Rule::enum(AnnouncementCategory::class)],
|
||||
'excerpt' => ['nullable', 'string', 'max:500'],
|
||||
'content' => ['sometimes', 'string'],
|
||||
'image' => ['nullable', 'string', 'max:255'],
|
||||
'is_featured' => ['sometimes', 'boolean'],
|
||||
'meta_title' => ['nullable', 'string', 'max:255'],
|
||||
'meta_description' => ['nullable', 'string', 'max:255'],
|
||||
'published_at' => ['nullable', 'date'],
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
* @return array<string, string>
|
||||
*/
|
||||
public function messages(): array
|
||||
{
|
||||
return [
|
||||
'slug.unique' => 'Bu slug zaten kullanılıyor.',
|
||||
];
|
||||
}
|
||||
}
|
||||
36
app/Http/Requests/Auth/LoginRequest.php
Normal file
36
app/Http/Requests/Auth/LoginRequest.php
Normal file
@@ -0,0 +1,36 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Requests\Auth;
|
||||
|
||||
use Illuminate\Foundation\Http\FormRequest;
|
||||
|
||||
class LoginRequest extends FormRequest
|
||||
{
|
||||
public function authorize(): bool
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return array<string, array<int, string>>
|
||||
*/
|
||||
public function rules(): array
|
||||
{
|
||||
return [
|
||||
'email' => ['required', 'string', 'email'],
|
||||
'password' => ['required', 'string'],
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
* @return array<string, string>
|
||||
*/
|
||||
public function messages(): array
|
||||
{
|
||||
return [
|
||||
'email.required' => 'E-posta adresi zorunludur.',
|
||||
'email.email' => 'Geçerli bir e-posta adresi giriniz.',
|
||||
'password.required' => 'Şifre zorunludur.',
|
||||
];
|
||||
}
|
||||
}
|
||||
40
app/Http/Requests/Category/StoreCategoryRequest.php
Normal file
40
app/Http/Requests/Category/StoreCategoryRequest.php
Normal file
@@ -0,0 +1,40 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Requests\Category;
|
||||
|
||||
use Illuminate\Foundation\Http\FormRequest;
|
||||
|
||||
class StoreCategoryRequest extends FormRequest
|
||||
{
|
||||
public function authorize(): bool
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return array<string, array<int, string>>
|
||||
*/
|
||||
public function rules(): array
|
||||
{
|
||||
return [
|
||||
'slug' => ['required', 'string', 'max:255', 'unique:categories,slug'],
|
||||
'label' => ['required', 'string', 'max:255'],
|
||||
'desc' => ['nullable', 'string'],
|
||||
'image' => ['nullable', 'string', 'max:255'],
|
||||
'meta_title' => ['nullable', 'string', 'max:255'],
|
||||
'meta_description' => ['nullable', 'string'],
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
* @return array<string, string>
|
||||
*/
|
||||
public function messages(): array
|
||||
{
|
||||
return [
|
||||
'slug.required' => 'Slug alanı zorunludur.',
|
||||
'slug.unique' => 'Bu slug zaten kullanılıyor.',
|
||||
'label.required' => 'Kategori adı zorunludur.',
|
||||
];
|
||||
}
|
||||
}
|
||||
41
app/Http/Requests/Category/UpdateCategoryRequest.php
Normal file
41
app/Http/Requests/Category/UpdateCategoryRequest.php
Normal file
@@ -0,0 +1,41 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Requests\Category;
|
||||
|
||||
use Illuminate\Foundation\Http\FormRequest;
|
||||
use Illuminate\Validation\Rule;
|
||||
|
||||
class UpdateCategoryRequest extends FormRequest
|
||||
{
|
||||
public function authorize(): bool
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return array<string, array<int, mixed>>
|
||||
*/
|
||||
public function rules(): array
|
||||
{
|
||||
return [
|
||||
'slug' => ['required', 'string', 'max:255', Rule::unique('categories', 'slug')->ignore($this->route('category'))],
|
||||
'label' => ['required', 'string', 'max:255'],
|
||||
'desc' => ['nullable', 'string'],
|
||||
'image' => ['nullable', 'string', 'max:255'],
|
||||
'meta_title' => ['nullable', 'string', 'max:255'],
|
||||
'meta_description' => ['nullable', 'string'],
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
* @return array<string, string>
|
||||
*/
|
||||
public function messages(): array
|
||||
{
|
||||
return [
|
||||
'slug.required' => 'Slug alanı zorunludur.',
|
||||
'slug.unique' => 'Bu slug zaten kullanılıyor.',
|
||||
'label.required' => 'Kategori adı zorunludur.',
|
||||
];
|
||||
}
|
||||
}
|
||||
44
app/Http/Requests/Comment/StoreCommentRequest.php
Normal file
44
app/Http/Requests/Comment/StoreCommentRequest.php
Normal file
@@ -0,0 +1,44 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Requests\Comment;
|
||||
|
||||
use Illuminate\Foundation\Http\FormRequest;
|
||||
|
||||
class StoreCommentRequest extends FormRequest
|
||||
{
|
||||
public function authorize(): bool
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return array<string, array<int, string>>
|
||||
*/
|
||||
public function rules(): array
|
||||
{
|
||||
return [
|
||||
'commentable_type' => ['required', 'string', 'in:course,category,announcement'],
|
||||
'commentable_id' => ['required', 'integer'],
|
||||
'author_name' => ['required', 'string', 'max:255'],
|
||||
'content' => ['required', 'string', 'max:1000'],
|
||||
'rating' => ['nullable', 'integer', 'min:1', 'max:5'],
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
* @return array<string, string>
|
||||
*/
|
||||
public function messages(): array
|
||||
{
|
||||
return [
|
||||
'commentable_type.required' => 'Yorum tipi zorunludur.',
|
||||
'commentable_type.in' => 'Geçersiz yorum tipi.',
|
||||
'commentable_id.required' => 'Yorum hedefi zorunludur.',
|
||||
'author_name.required' => 'İsim zorunludur.',
|
||||
'content.required' => 'Yorum içeriği zorunludur.',
|
||||
'content.max' => 'Yorum en fazla 1000 karakter olabilir.',
|
||||
'rating.min' => 'Puan en az 1 olabilir.',
|
||||
'rating.max' => 'Puan en fazla 5 olabilir.',
|
||||
];
|
||||
}
|
||||
}
|
||||
34
app/Http/Requests/Comment/UpdateCommentRequest.php
Normal file
34
app/Http/Requests/Comment/UpdateCommentRequest.php
Normal file
@@ -0,0 +1,34 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Requests\Comment;
|
||||
|
||||
use Illuminate\Foundation\Http\FormRequest;
|
||||
|
||||
class UpdateCommentRequest extends FormRequest
|
||||
{
|
||||
public function authorize(): bool
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return array<string, array<int, string>>
|
||||
*/
|
||||
public function rules(): array
|
||||
{
|
||||
return [
|
||||
'is_approved' => ['sometimes', 'boolean'],
|
||||
'admin_reply' => ['nullable', 'string', 'max:1000'],
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
* @return array<string, string>
|
||||
*/
|
||||
public function messages(): array
|
||||
{
|
||||
return [
|
||||
'admin_reply.max' => 'Admin yanıtı en fazla 1000 karakter olabilir.',
|
||||
];
|
||||
}
|
||||
}
|
||||
64
app/Http/Requests/Course/StoreCourseRequest.php
Normal file
64
app/Http/Requests/Course/StoreCourseRequest.php
Normal file
@@ -0,0 +1,64 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Requests\Course;
|
||||
|
||||
use App\Enums\CourseBadge;
|
||||
use Illuminate\Foundation\Http\FormRequest;
|
||||
use Illuminate\Validation\Rule;
|
||||
|
||||
class StoreCourseRequest extends FormRequest
|
||||
{
|
||||
public function authorize(): bool
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return array<string, array<int, string>>
|
||||
*/
|
||||
public function rules(): array
|
||||
{
|
||||
return [
|
||||
'category_id' => ['required', 'integer', 'exists:categories,id'],
|
||||
'slug' => ['required', 'string', 'max:255', 'unique:courses,slug'],
|
||||
'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<string, string>
|
||||
*/
|
||||
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.',
|
||||
'desc.required' => 'Kısa açıklama zorunludur.',
|
||||
'long_desc.required' => 'Detaylı açıklama zorunludur.',
|
||||
'duration.required' => 'Süre alanı zorunludur.',
|
||||
];
|
||||
}
|
||||
}
|
||||
61
app/Http/Requests/Course/UpdateCourseRequest.php
Normal file
61
app/Http/Requests/Course/UpdateCourseRequest.php
Normal file
@@ -0,0 +1,61 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Requests\Course;
|
||||
|
||||
use App\Enums\CourseBadge;
|
||||
use Illuminate\Foundation\Http\FormRequest;
|
||||
use Illuminate\Validation\Rule;
|
||||
|
||||
class UpdateCourseRequest extends FormRequest
|
||||
{
|
||||
public function authorize(): bool
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return array<string, array<int, mixed>>
|
||||
*/
|
||||
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<string, string>
|
||||
*/
|
||||
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.',
|
||||
];
|
||||
}
|
||||
}
|
||||
41
app/Http/Requests/Faq/StoreFaqRequest.php
Normal file
41
app/Http/Requests/Faq/StoreFaqRequest.php
Normal file
@@ -0,0 +1,41 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Requests\Faq;
|
||||
|
||||
use App\Enums\FaqCategory;
|
||||
use Illuminate\Foundation\Http\FormRequest;
|
||||
use Illuminate\Validation\Rule;
|
||||
|
||||
class StoreFaqRequest extends FormRequest
|
||||
{
|
||||
public function authorize(): bool
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return array<string, array<int, mixed>>
|
||||
*/
|
||||
public function rules(): array
|
||||
{
|
||||
return [
|
||||
'question' => ['required', 'string', 'max:500'],
|
||||
'answer' => ['required', 'string'],
|
||||
'category' => ['required', 'string', Rule::enum(FaqCategory::class)],
|
||||
'order_index' => ['sometimes', 'integer', 'min:0'],
|
||||
'is_active' => ['sometimes', 'boolean'],
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
* @return array<string, string>
|
||||
*/
|
||||
public function messages(): array
|
||||
{
|
||||
return [
|
||||
'question.required' => 'Soru zorunludur.',
|
||||
'answer.required' => 'Cevap zorunludur.',
|
||||
'category.required' => 'Kategori zorunludur.',
|
||||
];
|
||||
}
|
||||
}
|
||||
29
app/Http/Requests/Faq/UpdateFaqRequest.php
Normal file
29
app/Http/Requests/Faq/UpdateFaqRequest.php
Normal file
@@ -0,0 +1,29 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Requests\Faq;
|
||||
|
||||
use App\Enums\FaqCategory;
|
||||
use Illuminate\Foundation\Http\FormRequest;
|
||||
use Illuminate\Validation\Rule;
|
||||
|
||||
class UpdateFaqRequest extends FormRequest
|
||||
{
|
||||
public function authorize(): bool
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return array<string, array<int, mixed>>
|
||||
*/
|
||||
public function rules(): array
|
||||
{
|
||||
return [
|
||||
'question' => ['sometimes', 'string', 'max:500'],
|
||||
'answer' => ['sometimes', 'string'],
|
||||
'category' => ['sometimes', 'string', Rule::enum(FaqCategory::class)],
|
||||
'order_index' => ['sometimes', 'integer', 'min:0'],
|
||||
'is_active' => ['sometimes', 'boolean'],
|
||||
];
|
||||
}
|
||||
}
|
||||
38
app/Http/Requests/GuideCard/StoreGuideCardRequest.php
Normal file
38
app/Http/Requests/GuideCard/StoreGuideCardRequest.php
Normal file
@@ -0,0 +1,38 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Requests\GuideCard;
|
||||
|
||||
use Illuminate\Foundation\Http\FormRequest;
|
||||
|
||||
class StoreGuideCardRequest extends FormRequest
|
||||
{
|
||||
public function authorize(): bool
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return array<string, array<int, string>>
|
||||
*/
|
||||
public function rules(): array
|
||||
{
|
||||
return [
|
||||
'title' => ['required', 'string', 'max:255'],
|
||||
'description' => ['required', 'string', 'max:500'],
|
||||
'icon' => ['nullable', 'string', 'max:100'],
|
||||
'order_index' => ['sometimes', 'integer', 'min:0'],
|
||||
'is_active' => ['sometimes', 'boolean'],
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
* @return array<string, string>
|
||||
*/
|
||||
public function messages(): array
|
||||
{
|
||||
return [
|
||||
'title.required' => 'Başlık zorunludur.',
|
||||
'description.required' => 'Açıklama zorunludur.',
|
||||
];
|
||||
}
|
||||
}
|
||||
27
app/Http/Requests/GuideCard/UpdateGuideCardRequest.php
Normal file
27
app/Http/Requests/GuideCard/UpdateGuideCardRequest.php
Normal file
@@ -0,0 +1,27 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Requests\GuideCard;
|
||||
|
||||
use Illuminate\Foundation\Http\FormRequest;
|
||||
|
||||
class UpdateGuideCardRequest extends FormRequest
|
||||
{
|
||||
public function authorize(): bool
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return array<string, array<int, string>>
|
||||
*/
|
||||
public function rules(): array
|
||||
{
|
||||
return [
|
||||
'title' => ['sometimes', 'string', 'max:255'],
|
||||
'description' => ['sometimes', 'string', 'max:500'],
|
||||
'icon' => ['nullable', 'string', 'max:100'],
|
||||
'order_index' => ['sometimes', 'integer', 'min:0'],
|
||||
'is_active' => ['sometimes', 'boolean'],
|
||||
];
|
||||
}
|
||||
}
|
||||
44
app/Http/Requests/HeroSlide/StoreHeroSlideRequest.php
Normal file
44
app/Http/Requests/HeroSlide/StoreHeroSlideRequest.php
Normal file
@@ -0,0 +1,44 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Requests\HeroSlide;
|
||||
|
||||
use Illuminate\Foundation\Http\FormRequest;
|
||||
|
||||
class StoreHeroSlideRequest extends FormRequest
|
||||
{
|
||||
public function authorize(): bool
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return array<string, array<int, string>>
|
||||
*/
|
||||
public function rules(): array
|
||||
{
|
||||
return [
|
||||
'label' => ['nullable', 'string', 'max:255'],
|
||||
'title' => ['required', 'string', 'max:255'],
|
||||
'description' => ['nullable', 'string'],
|
||||
'media_type' => ['sometimes', 'string', 'in:image,video'],
|
||||
'image' => ['nullable', 'string', 'max:255'],
|
||||
'video_url' => ['nullable', 'string', 'max:255'],
|
||||
'mobile_video_url' => ['nullable', 'string', 'max:255'],
|
||||
'mobile_image' => ['nullable', 'string', 'max:255'],
|
||||
'button_text' => ['nullable', 'string', 'max:100'],
|
||||
'button_url' => ['nullable', 'string', 'max:255'],
|
||||
'order_index' => ['sometimes', 'integer', 'min:0'],
|
||||
'is_active' => ['sometimes', 'boolean'],
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
* @return array<string, string>
|
||||
*/
|
||||
public function messages(): array
|
||||
{
|
||||
return [
|
||||
'title.required' => 'Başlık zorunludur.',
|
||||
];
|
||||
}
|
||||
}
|
||||
34
app/Http/Requests/HeroSlide/UpdateHeroSlideRequest.php
Normal file
34
app/Http/Requests/HeroSlide/UpdateHeroSlideRequest.php
Normal file
@@ -0,0 +1,34 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Requests\HeroSlide;
|
||||
|
||||
use Illuminate\Foundation\Http\FormRequest;
|
||||
|
||||
class UpdateHeroSlideRequest extends FormRequest
|
||||
{
|
||||
public function authorize(): bool
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return array<string, array<int, string>>
|
||||
*/
|
||||
public function rules(): array
|
||||
{
|
||||
return [
|
||||
'label' => ['nullable', 'string', 'max:255'],
|
||||
'title' => ['sometimes', 'string', 'max:255'],
|
||||
'description' => ['nullable', 'string'],
|
||||
'media_type' => ['sometimes', 'string', 'in:image,video'],
|
||||
'image' => ['nullable', 'string', 'max:255'],
|
||||
'video_url' => ['nullable', 'string', 'max:255'],
|
||||
'mobile_video_url' => ['nullable', 'string', 'max:255'],
|
||||
'mobile_image' => ['nullable', 'string', 'max:255'],
|
||||
'button_text' => ['nullable', 'string', 'max:100'],
|
||||
'button_url' => ['nullable', 'string', 'max:255'],
|
||||
'order_index' => ['sometimes', 'integer', 'min:0'],
|
||||
'is_active' => ['sometimes', 'boolean'],
|
||||
];
|
||||
}
|
||||
}
|
||||
51
app/Http/Requests/Lead/StoreLeadRequest.php
Normal file
51
app/Http/Requests/Lead/StoreLeadRequest.php
Normal file
@@ -0,0 +1,51 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Requests\Lead;
|
||||
|
||||
use App\Enums\LeadSource;
|
||||
use Illuminate\Foundation\Http\FormRequest;
|
||||
use Illuminate\Validation\Rule;
|
||||
|
||||
class StoreLeadRequest extends FormRequest
|
||||
{
|
||||
public function authorize(): bool
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return array<string, array<int, mixed>>
|
||||
*/
|
||||
public function rules(): array
|
||||
{
|
||||
return [
|
||||
'name' => ['required', 'string', 'max:255'],
|
||||
'phone' => ['required', 'string', 'max:20'],
|
||||
'email' => ['nullable', 'email', 'max:255'],
|
||||
'source' => ['required', 'string', Rule::enum(LeadSource::class)],
|
||||
'target_course' => ['nullable', 'string', 'max:255'],
|
||||
'education_level' => ['nullable', 'string', 'max:255'],
|
||||
'subject' => ['nullable', 'string', 'max:255'],
|
||||
'message' => ['nullable', 'string'],
|
||||
'kvkk_consent' => ['required', 'accepted'],
|
||||
'marketing_consent' => ['sometimes', 'boolean'],
|
||||
'utm_source' => ['nullable', 'string', 'max:255'],
|
||||
'utm_medium' => ['nullable', 'string', 'max:255'],
|
||||
'utm_campaign' => ['nullable', 'string', 'max:255'],
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
* @return array<string, string>
|
||||
*/
|
||||
public function messages(): array
|
||||
{
|
||||
return [
|
||||
'name.required' => 'Ad Soyad zorunludur.',
|
||||
'phone.required' => 'Telefon numarası zorunludur.',
|
||||
'source.required' => 'Kaynak bilgisi zorunludur.',
|
||||
'kvkk_consent.required' => 'KVKK onayı zorunludur.',
|
||||
'kvkk_consent.accepted' => 'KVKK metnini onaylamanız gerekmektedir.',
|
||||
];
|
||||
}
|
||||
}
|
||||
37
app/Http/Requests/Lead/UpdateLeadRequest.php
Normal file
37
app/Http/Requests/Lead/UpdateLeadRequest.php
Normal file
@@ -0,0 +1,37 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Requests\Lead;
|
||||
|
||||
use App\Enums\LeadStatus;
|
||||
use Illuminate\Foundation\Http\FormRequest;
|
||||
use Illuminate\Validation\Rule;
|
||||
|
||||
class UpdateLeadRequest extends FormRequest
|
||||
{
|
||||
public function authorize(): bool
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return array<string, array<int, mixed>>
|
||||
*/
|
||||
public function rules(): array
|
||||
{
|
||||
return [
|
||||
'status' => ['sometimes', 'string', Rule::enum(LeadStatus::class)],
|
||||
'is_read' => ['sometimes', 'boolean'],
|
||||
'admin_note' => ['nullable', 'string'],
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
* @return array<string, string>
|
||||
*/
|
||||
public function messages(): array
|
||||
{
|
||||
return [
|
||||
'status.in' => 'Geçersiz durum değeri.',
|
||||
];
|
||||
}
|
||||
}
|
||||
39
app/Http/Requests/Menu/ReorderMenuRequest.php
Normal file
39
app/Http/Requests/Menu/ReorderMenuRequest.php
Normal file
@@ -0,0 +1,39 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Requests\Menu;
|
||||
|
||||
use Illuminate\Foundation\Http\FormRequest;
|
||||
|
||||
class ReorderMenuRequest extends FormRequest
|
||||
{
|
||||
public function authorize(): bool
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return array<string, array<int, string>>
|
||||
*/
|
||||
public function rules(): array
|
||||
{
|
||||
return [
|
||||
'items' => ['required', 'array', 'min:1'],
|
||||
'items.*.id' => ['required', 'integer', 'exists:menus,id'],
|
||||
'items.*.order_index' => ['required', 'integer', 'min:0'],
|
||||
'items.*.parent_id' => ['nullable', 'integer', 'exists:menus,id'],
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
* @return array<string, string>
|
||||
*/
|
||||
public function messages(): array
|
||||
{
|
||||
return [
|
||||
'items.required' => 'Sıralama verileri zorunludur.',
|
||||
'items.*.id.required' => 'Menü ID zorunludur.',
|
||||
'items.*.id.exists' => 'Menü bulunamadı.',
|
||||
'items.*.order_index.required' => 'Sıra numarası zorunludur.',
|
||||
];
|
||||
}
|
||||
}
|
||||
46
app/Http/Requests/Menu/StoreMenuRequest.php
Normal file
46
app/Http/Requests/Menu/StoreMenuRequest.php
Normal file
@@ -0,0 +1,46 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Requests\Menu;
|
||||
|
||||
use App\Enums\MenuLocation;
|
||||
use App\Enums\MenuType;
|
||||
use Illuminate\Foundation\Http\FormRequest;
|
||||
use Illuminate\Validation\Rule;
|
||||
|
||||
class StoreMenuRequest extends FormRequest
|
||||
{
|
||||
public function authorize(): bool
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return array<string, array<int, mixed>>
|
||||
*/
|
||||
public function rules(): array
|
||||
{
|
||||
return [
|
||||
'label' => ['required', 'string', 'max:255'],
|
||||
'url' => ['required', 'string', 'max:255'],
|
||||
'location' => ['required', 'string', Rule::enum(MenuLocation::class)],
|
||||
'type' => ['required', 'string', Rule::enum(MenuType::class)],
|
||||
'parent_id' => ['nullable', 'integer', 'exists:menus,id'],
|
||||
'order_index' => ['sometimes', 'integer', 'min:0'],
|
||||
'is_active' => ['sometimes', 'boolean'],
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
* @return array<string, string>
|
||||
*/
|
||||
public function messages(): array
|
||||
{
|
||||
return [
|
||||
'label.required' => 'Menü etiketi zorunludur.',
|
||||
'url.required' => 'URL zorunludur.',
|
||||
'location.required' => 'Menü konumu zorunludur.',
|
||||
'type.required' => 'Menü tipi zorunludur.',
|
||||
'parent_id.exists' => 'Üst menü bulunamadı.',
|
||||
];
|
||||
}
|
||||
}
|
||||
42
app/Http/Requests/Menu/UpdateMenuRequest.php
Normal file
42
app/Http/Requests/Menu/UpdateMenuRequest.php
Normal file
@@ -0,0 +1,42 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Requests\Menu;
|
||||
|
||||
use App\Enums\MenuLocation;
|
||||
use App\Enums\MenuType;
|
||||
use Illuminate\Foundation\Http\FormRequest;
|
||||
use Illuminate\Validation\Rule;
|
||||
|
||||
class UpdateMenuRequest extends FormRequest
|
||||
{
|
||||
public function authorize(): bool
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return array<string, array<int, mixed>>
|
||||
*/
|
||||
public function rules(): array
|
||||
{
|
||||
return [
|
||||
'label' => ['sometimes', 'string', 'max:255'],
|
||||
'url' => ['sometimes', 'string', 'max:255'],
|
||||
'location' => ['sometimes', 'string', Rule::enum(MenuLocation::class)],
|
||||
'type' => ['sometimes', 'string', Rule::enum(MenuType::class)],
|
||||
'parent_id' => ['nullable', 'integer', 'exists:menus,id'],
|
||||
'order_index' => ['sometimes', 'integer', 'min:0'],
|
||||
'is_active' => ['sometimes', 'boolean'],
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
* @return array<string, string>
|
||||
*/
|
||||
public function messages(): array
|
||||
{
|
||||
return [
|
||||
'parent_id.exists' => 'Üst menü bulunamadı.',
|
||||
];
|
||||
}
|
||||
}
|
||||
44
app/Http/Requests/Page/StorePageRequest.php
Normal file
44
app/Http/Requests/Page/StorePageRequest.php
Normal file
@@ -0,0 +1,44 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Requests\Page;
|
||||
|
||||
use Illuminate\Foundation\Http\FormRequest;
|
||||
|
||||
class StorePageRequest extends FormRequest
|
||||
{
|
||||
public function authorize(): bool
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return array<string, array<int, string>>
|
||||
*/
|
||||
public function rules(): array
|
||||
{
|
||||
return [
|
||||
'slug' => ['required', 'string', 'max:255', 'unique:pages,slug'],
|
||||
'title' => ['required', 'string', 'max:255'],
|
||||
'content' => ['nullable', 'string'],
|
||||
'meta_title' => ['nullable', 'string', 'max:255'],
|
||||
'meta_description' => ['nullable', 'string', 'max:255'],
|
||||
'is_active' => ['sometimes', 'boolean'],
|
||||
'blocks' => ['sometimes', 'array'],
|
||||
'blocks.*.type' => ['required_with:blocks', 'string', 'max:50'],
|
||||
'blocks.*.content' => ['required_with:blocks', 'array'],
|
||||
'blocks.*.order_index' => ['sometimes', 'integer', 'min:0'],
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
* @return array<string, string>
|
||||
*/
|
||||
public function messages(): array
|
||||
{
|
||||
return [
|
||||
'slug.required' => 'URL slug alanı zorunludur.',
|
||||
'slug.unique' => 'Bu slug zaten kullanılıyor.',
|
||||
'title.required' => 'Başlık zorunludur.',
|
||||
];
|
||||
}
|
||||
}
|
||||
43
app/Http/Requests/Page/UpdatePageRequest.php
Normal file
43
app/Http/Requests/Page/UpdatePageRequest.php
Normal file
@@ -0,0 +1,43 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Requests\Page;
|
||||
|
||||
use Illuminate\Foundation\Http\FormRequest;
|
||||
use Illuminate\Validation\Rule;
|
||||
|
||||
class UpdatePageRequest extends FormRequest
|
||||
{
|
||||
public function authorize(): bool
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return array<string, array<int, mixed>>
|
||||
*/
|
||||
public function rules(): array
|
||||
{
|
||||
return [
|
||||
'slug' => ['sometimes', 'string', 'max:255', Rule::unique('pages', 'slug')->ignore($this->route('page'))],
|
||||
'title' => ['sometimes', 'string', 'max:255'],
|
||||
'content' => ['nullable', 'string'],
|
||||
'meta_title' => ['nullable', 'string', 'max:255'],
|
||||
'meta_description' => ['nullable', 'string', 'max:255'],
|
||||
'is_active' => ['sometimes', 'boolean'],
|
||||
'blocks' => ['sometimes', 'array'],
|
||||
'blocks.*.type' => ['required_with:blocks', 'string', 'max:50'],
|
||||
'blocks.*.content' => ['required_with:blocks', 'array'],
|
||||
'blocks.*.order_index' => ['sometimes', 'integer', 'min:0'],
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
* @return array<string, string>
|
||||
*/
|
||||
public function messages(): array
|
||||
{
|
||||
return [
|
||||
'slug.unique' => 'Bu slug zaten kullanılıyor.',
|
||||
];
|
||||
}
|
||||
}
|
||||
41
app/Http/Requests/Preview/StorePreviewRequest.php
Normal file
41
app/Http/Requests/Preview/StorePreviewRequest.php
Normal file
@@ -0,0 +1,41 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Requests\Preview;
|
||||
|
||||
use Illuminate\Foundation\Http\FormRequest;
|
||||
|
||||
class StorePreviewRequest extends FormRequest
|
||||
{
|
||||
public function authorize(): bool
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return array<string, array<int, string>>
|
||||
*/
|
||||
public function rules(): array
|
||||
{
|
||||
return [
|
||||
'page_id' => ['required', 'integer', 'exists:pages,id'],
|
||||
'blocks' => ['present', 'array'],
|
||||
'blocks.*.type' => ['required', 'string', 'max:50'],
|
||||
'blocks.*.content' => ['present', 'array'],
|
||||
'blocks.*.order_index' => ['required', 'integer', 'min:0'],
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
* @return array<string, string>
|
||||
*/
|
||||
public function messages(): array
|
||||
{
|
||||
return [
|
||||
'page_id.required' => 'Sayfa ID zorunludur.',
|
||||
'page_id.exists' => 'Geçersiz sayfa.',
|
||||
'blocks.present' => 'Bloklar alanı gereklidir.',
|
||||
'blocks.*.type.required' => 'Blok tipi zorunludur.',
|
||||
'blocks.*.order_index.required' => 'Blok sırası zorunludur.',
|
||||
];
|
||||
}
|
||||
}
|
||||
39
app/Http/Requests/Role/StoreRoleRequest.php
Normal file
39
app/Http/Requests/Role/StoreRoleRequest.php
Normal file
@@ -0,0 +1,39 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Requests\Role;
|
||||
|
||||
use Illuminate\Foundation\Http\FormRequest;
|
||||
|
||||
class StoreRoleRequest extends FormRequest
|
||||
{
|
||||
public function authorize(): bool
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return array<string, array<int, string>>
|
||||
*/
|
||||
public function rules(): array
|
||||
{
|
||||
return [
|
||||
'name' => ['required', 'string', 'max:255', 'unique:roles,name'],
|
||||
'permissions' => ['required', 'array', 'min:1'],
|
||||
'permissions.*' => ['string', 'exists:permissions,name'],
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
* @return array<string, string>
|
||||
*/
|
||||
public function messages(): array
|
||||
{
|
||||
return [
|
||||
'name.required' => 'Rol adı zorunludur.',
|
||||
'name.unique' => 'Bu rol adı zaten kullanılıyor.',
|
||||
'permissions.required' => 'En az bir yetki seçilmelidir.',
|
||||
'permissions.min' => 'En az bir yetki seçilmelidir.',
|
||||
'permissions.*.exists' => 'Geçersiz yetki.',
|
||||
];
|
||||
}
|
||||
}
|
||||
39
app/Http/Requests/Role/UpdateRoleRequest.php
Normal file
39
app/Http/Requests/Role/UpdateRoleRequest.php
Normal file
@@ -0,0 +1,39 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Requests\Role;
|
||||
|
||||
use Illuminate\Foundation\Http\FormRequest;
|
||||
use Illuminate\Validation\Rule;
|
||||
|
||||
class UpdateRoleRequest extends FormRequest
|
||||
{
|
||||
public function authorize(): bool
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return array<string, array<int, mixed>>
|
||||
*/
|
||||
public function rules(): array
|
||||
{
|
||||
return [
|
||||
'name' => ['sometimes', 'required', 'string', 'max:255', Rule::unique('roles', 'name')->ignore($this->route('role'))],
|
||||
'permissions' => ['sometimes', 'required', 'array', 'min:1'],
|
||||
'permissions.*' => ['string', 'exists:permissions,name'],
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
* @return array<string, string>
|
||||
*/
|
||||
public function messages(): array
|
||||
{
|
||||
return [
|
||||
'name.required' => 'Rol adı zorunludur.',
|
||||
'name.unique' => 'Bu rol adı zaten kullanılıyor.',
|
||||
'permissions.min' => 'En az bir yetki seçilmelidir.',
|
||||
'permissions.*.exists' => 'Geçersiz yetki.',
|
||||
];
|
||||
}
|
||||
}
|
||||
49
app/Http/Requests/Schedule/StoreScheduleRequest.php
Normal file
49
app/Http/Requests/Schedule/StoreScheduleRequest.php
Normal file
@@ -0,0 +1,49 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Requests\Schedule;
|
||||
|
||||
use Illuminate\Foundation\Http\FormRequest;
|
||||
|
||||
class StoreScheduleRequest extends FormRequest
|
||||
{
|
||||
public function authorize(): bool
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return array<string, array<int, string>>
|
||||
*/
|
||||
public function rules(): array
|
||||
{
|
||||
return [
|
||||
'course_id' => ['required', 'integer', 'exists:courses,id'],
|
||||
'start_date' => ['required', 'date', 'after_or_equal:today'],
|
||||
'end_date' => ['required', 'date', 'after:start_date'],
|
||||
'location' => ['required', 'string', 'max:255'],
|
||||
'quota' => ['required', 'integer', 'min:1'],
|
||||
'available_seats' => ['required', 'integer', 'min:0', 'lte:quota'],
|
||||
'is_urgent' => ['sometimes', 'boolean'],
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
* @return array<string, string>
|
||||
*/
|
||||
public function messages(): array
|
||||
{
|
||||
return [
|
||||
'course_id.required' => 'Eğitim seçimi zorunludur.',
|
||||
'course_id.exists' => 'Seçilen eğitim bulunamadı.',
|
||||
'start_date.required' => 'Başlangıç tarihi zorunludur.',
|
||||
'start_date.after_or_equal' => 'Başlangıç tarihi bugün veya sonrası olmalıdır.',
|
||||
'end_date.required' => 'Bitiş tarihi zorunludur.',
|
||||
'end_date.after' => 'Bitiş tarihi başlangıçtan sonra olmalıdır.',
|
||||
'location.required' => 'Konum zorunludur.',
|
||||
'quota.required' => 'Kontenjan zorunludur.',
|
||||
'quota.min' => 'Kontenjan en az 1 olmalıdır.',
|
||||
'available_seats.required' => 'Müsait koltuk sayısı zorunludur.',
|
||||
'available_seats.lte' => 'Müsait koltuk sayısı kontenjandan fazla olamaz.',
|
||||
];
|
||||
}
|
||||
}
|
||||
42
app/Http/Requests/Schedule/UpdateScheduleRequest.php
Normal file
42
app/Http/Requests/Schedule/UpdateScheduleRequest.php
Normal file
@@ -0,0 +1,42 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Requests\Schedule;
|
||||
|
||||
use Illuminate\Foundation\Http\FormRequest;
|
||||
|
||||
class UpdateScheduleRequest extends FormRequest
|
||||
{
|
||||
public function authorize(): bool
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return array<string, array<int, string>>
|
||||
*/
|
||||
public function rules(): array
|
||||
{
|
||||
return [
|
||||
'course_id' => ['sometimes', 'integer', 'exists:courses,id'],
|
||||
'start_date' => ['sometimes', 'date'],
|
||||
'end_date' => ['sometimes', 'date', 'after:start_date'],
|
||||
'location' => ['sometimes', 'string', 'max:255'],
|
||||
'quota' => ['sometimes', 'integer', 'min:1'],
|
||||
'available_seats' => ['sometimes', 'integer', 'min:0', 'lte:quota'],
|
||||
'is_urgent' => ['sometimes', 'boolean'],
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
* @return array<string, string>
|
||||
*/
|
||||
public function messages(): array
|
||||
{
|
||||
return [
|
||||
'course_id.exists' => 'Seçilen eğitim bulunamadı.',
|
||||
'end_date.after' => 'Bitiş tarihi başlangıçtan sonra olmalıdır.',
|
||||
'quota.min' => 'Kontenjan en az 1 olmalıdır.',
|
||||
'available_seats.lte' => 'Müsait koltuk sayısı kontenjandan fazla olamaz.',
|
||||
];
|
||||
}
|
||||
}
|
||||
35
app/Http/Requests/Setting/UpdateSettingsRequest.php
Normal file
35
app/Http/Requests/Setting/UpdateSettingsRequest.php
Normal file
@@ -0,0 +1,35 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Requests\Setting;
|
||||
|
||||
use Illuminate\Foundation\Http\FormRequest;
|
||||
|
||||
class UpdateSettingsRequest extends FormRequest
|
||||
{
|
||||
public function authorize(): bool
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return array<string, array<int, string>>
|
||||
*/
|
||||
public function rules(): array
|
||||
{
|
||||
return [
|
||||
'settings' => ['required', 'array'],
|
||||
'settings.*' => ['nullable', 'string'],
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
* @return array<string, string>
|
||||
*/
|
||||
public function messages(): array
|
||||
{
|
||||
return [
|
||||
'settings.required' => 'Ayarlar zorunludur.',
|
||||
'settings.array' => 'Ayarlar bir dizi olmalıdır.',
|
||||
];
|
||||
}
|
||||
}
|
||||
43
app/Http/Requests/User/StoreUserRequest.php
Normal file
43
app/Http/Requests/User/StoreUserRequest.php
Normal file
@@ -0,0 +1,43 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Requests\User;
|
||||
|
||||
use Illuminate\Foundation\Http\FormRequest;
|
||||
|
||||
class StoreUserRequest extends FormRequest
|
||||
{
|
||||
public function authorize(): bool
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return array<string, array<int, string>>
|
||||
*/
|
||||
public function rules(): array
|
||||
{
|
||||
return [
|
||||
'name' => ['required', 'string', 'max:255'],
|
||||
'email' => ['required', 'string', 'email', 'max:255', 'unique:users,email'],
|
||||
'password' => ['required', 'string', 'min:8', 'confirmed'],
|
||||
'role' => ['required', 'string', 'exists:roles,name'],
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
* @return array<string, string>
|
||||
*/
|
||||
public function messages(): array
|
||||
{
|
||||
return [
|
||||
'name.required' => 'İsim alanı zorunludur.',
|
||||
'email.required' => 'E-posta alanı zorunludur.',
|
||||
'email.unique' => 'Bu e-posta adresi zaten kullanılıyor.',
|
||||
'password.required' => 'Şifre alanı zorunludur.',
|
||||
'password.min' => 'Şifre en az 8 karakter olmalıdır.',
|
||||
'password.confirmed' => 'Şifre tekrarı eşleşmiyor.',
|
||||
'role.required' => 'Rol alanı zorunludur.',
|
||||
'role.exists' => 'Geçersiz rol.',
|
||||
];
|
||||
}
|
||||
}
|
||||
42
app/Http/Requests/User/UpdateUserRequest.php
Normal file
42
app/Http/Requests/User/UpdateUserRequest.php
Normal file
@@ -0,0 +1,42 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Requests\User;
|
||||
|
||||
use Illuminate\Foundation\Http\FormRequest;
|
||||
use Illuminate\Validation\Rule;
|
||||
|
||||
class UpdateUserRequest extends FormRequest
|
||||
{
|
||||
public function authorize(): bool
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return array<string, array<int, mixed>>
|
||||
*/
|
||||
public function rules(): array
|
||||
{
|
||||
return [
|
||||
'name' => ['sometimes', 'required', 'string', 'max:255'],
|
||||
'email' => ['sometimes', 'required', 'string', 'email', 'max:255', Rule::unique('users', 'email')->ignore($this->route('user'))],
|
||||
'password' => ['nullable', 'string', 'min:8', 'confirmed'],
|
||||
'role' => ['sometimes', 'required', 'string', 'exists:roles,name'],
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
* @return array<string, string>
|
||||
*/
|
||||
public function messages(): array
|
||||
{
|
||||
return [
|
||||
'name.required' => 'İsim alanı zorunludur.',
|
||||
'email.required' => 'E-posta alanı zorunludur.',
|
||||
'email.unique' => 'Bu e-posta adresi zaten kullanılıyor.',
|
||||
'password.min' => 'Şifre en az 8 karakter olmalıdır.',
|
||||
'password.confirmed' => 'Şifre tekrarı eşleşmiyor.',
|
||||
'role.exists' => 'Geçersiz rol.',
|
||||
];
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user