update deploy
This commit is contained in:
42
database/factories/AnnouncementFactory.php
Normal file
42
database/factories/AnnouncementFactory.php
Normal file
@@ -0,0 +1,42 @@
|
||||
<?php
|
||||
|
||||
namespace Database\Factories;
|
||||
|
||||
use App\Enums\AnnouncementCategory;
|
||||
use App\Models\Announcement;
|
||||
use Illuminate\Database\Eloquent\Factories\Factory;
|
||||
use Illuminate\Support\Str;
|
||||
|
||||
/**
|
||||
* @extends Factory<Announcement>
|
||||
*/
|
||||
class AnnouncementFactory extends Factory
|
||||
{
|
||||
/**
|
||||
* @return array<string, mixed>
|
||||
*/
|
||||
public function definition(): array
|
||||
{
|
||||
$title = fake()->unique()->sentence(4);
|
||||
|
||||
return [
|
||||
'slug' => Str::slug($title),
|
||||
'title' => $title,
|
||||
'category' => fake()->randomElement(AnnouncementCategory::cases()),
|
||||
'excerpt' => fake()->paragraph(),
|
||||
'content' => fake()->paragraphs(5, true),
|
||||
'image' => null,
|
||||
'is_featured' => fake()->boolean(20),
|
||||
'meta_title' => fake()->sentence(4),
|
||||
'meta_description' => fake()->sentence(10),
|
||||
'published_at' => fake()->dateTimeBetween('-6 months', 'now'),
|
||||
];
|
||||
}
|
||||
|
||||
public function featured(): static
|
||||
{
|
||||
return $this->state(fn (array $attributes) => [
|
||||
'is_featured' => true,
|
||||
]);
|
||||
}
|
||||
}
|
||||
30
database/factories/CategoryFactory.php
Normal file
30
database/factories/CategoryFactory.php
Normal file
@@ -0,0 +1,30 @@
|
||||
<?php
|
||||
|
||||
namespace Database\Factories;
|
||||
|
||||
use App\Models\Category;
|
||||
use Illuminate\Database\Eloquent\Factories\Factory;
|
||||
use Illuminate\Support\Str;
|
||||
|
||||
/**
|
||||
* @extends Factory<Category>
|
||||
*/
|
||||
class CategoryFactory extends Factory
|
||||
{
|
||||
/**
|
||||
* @return array<string, mixed>
|
||||
*/
|
||||
public function definition(): array
|
||||
{
|
||||
$label = fake()->unique()->words(2, true);
|
||||
|
||||
return [
|
||||
'slug' => Str::slug($label),
|
||||
'label' => ucfirst($label),
|
||||
'desc' => fake()->paragraph(),
|
||||
'image' => null,
|
||||
'meta_title' => fake()->sentence(4),
|
||||
'meta_description' => fake()->sentence(10),
|
||||
];
|
||||
}
|
||||
}
|
||||
44
database/factories/CommentFactory.php
Normal file
44
database/factories/CommentFactory.php
Normal file
@@ -0,0 +1,44 @@
|
||||
<?php
|
||||
|
||||
namespace Database\Factories;
|
||||
|
||||
use App\Models\Comment;
|
||||
use App\Models\Course;
|
||||
use Illuminate\Database\Eloquent\Factories\Factory;
|
||||
|
||||
/**
|
||||
* @extends Factory<Comment>
|
||||
*/
|
||||
class CommentFactory extends Factory
|
||||
{
|
||||
/**
|
||||
* @return array<string, mixed>
|
||||
*/
|
||||
public function definition(): array
|
||||
{
|
||||
return [
|
||||
'commentable_id' => Course::factory(),
|
||||
'commentable_type' => Course::class,
|
||||
'name_surname' => fake()->name(),
|
||||
'phone' => fake()->phoneNumber(),
|
||||
'body' => fake()->paragraph(),
|
||||
'admin_reply' => null,
|
||||
'is_approved' => false,
|
||||
];
|
||||
}
|
||||
|
||||
public function approved(): static
|
||||
{
|
||||
return $this->state(fn (array $attributes) => [
|
||||
'is_approved' => true,
|
||||
]);
|
||||
}
|
||||
|
||||
public function withReply(): static
|
||||
{
|
||||
return $this->state(fn (array $attributes) => [
|
||||
'admin_reply' => fake()->paragraph(),
|
||||
'is_approved' => true,
|
||||
]);
|
||||
}
|
||||
}
|
||||
27
database/factories/CourseBlockFactory.php
Normal file
27
database/factories/CourseBlockFactory.php
Normal file
@@ -0,0 +1,27 @@
|
||||
<?php
|
||||
|
||||
namespace Database\Factories;
|
||||
|
||||
use App\Models\Course;
|
||||
use App\Models\CourseBlock;
|
||||
use Illuminate\Database\Eloquent\Factories\Factory;
|
||||
|
||||
/**
|
||||
* @extends Factory<CourseBlock>
|
||||
*/
|
||||
class CourseBlockFactory extends Factory
|
||||
{
|
||||
/**
|
||||
* @return array<string, mixed>
|
||||
*/
|
||||
public function definition(): array
|
||||
{
|
||||
return [
|
||||
'course_id' => Course::factory(),
|
||||
'type' => fake()->randomElement(['hero', 'text', 'cards', 'stats_grid', 'cta', 'faq', 'gallery']),
|
||||
'content' => ['title' => fake()->sentence()],
|
||||
'order_index' => fake()->numberBetween(0, 10),
|
||||
'is_active' => true,
|
||||
];
|
||||
}
|
||||
}
|
||||
45
database/factories/CourseFactory.php
Normal file
45
database/factories/CourseFactory.php
Normal file
@@ -0,0 +1,45 @@
|
||||
<?php
|
||||
|
||||
namespace Database\Factories;
|
||||
|
||||
use App\Models\Category;
|
||||
use App\Models\Course;
|
||||
use Illuminate\Database\Eloquent\Factories\Factory;
|
||||
use Illuminate\Support\Str;
|
||||
|
||||
/**
|
||||
* @extends Factory<Course>
|
||||
*/
|
||||
class CourseFactory extends Factory
|
||||
{
|
||||
/**
|
||||
* @return array<string, mixed>
|
||||
*/
|
||||
public function definition(): array
|
||||
{
|
||||
$title = fake()->unique()->words(3, true);
|
||||
|
||||
return [
|
||||
'category_id' => Category::factory(),
|
||||
'slug' => Str::slug($title),
|
||||
'title' => ucfirst($title),
|
||||
'sub' => fake()->optional()->word(),
|
||||
'desc' => fake()->paragraph(),
|
||||
'long_desc' => fake()->paragraphs(3, true),
|
||||
'duration' => fake()->randomElement(['3 Gün', '5 Gün', '10 Gün', '2 Hafta']),
|
||||
'students' => fake()->numberBetween(0, 500),
|
||||
'rating' => fake()->randomFloat(1, 3.0, 5.0),
|
||||
'badge' => fake()->optional()->randomElement(['Simülatör', 'Online', 'Yüz Yüze']),
|
||||
'image' => null,
|
||||
'price' => fake()->optional()->randomElement(['2.500 TL', '5.000 TL', '7.500 TL', '10.000 TL']),
|
||||
'includes' => fake()->words(4),
|
||||
'requirements' => fake()->words(3),
|
||||
'meta_title' => fake()->sentence(4),
|
||||
'meta_description' => fake()->sentence(10),
|
||||
'scope' => fake()->words(5),
|
||||
'standard' => fake()->optional()->randomElement(['STCW Uyumlu', 'IMO Uyumlu', 'STCW / IMO Uyumlu']),
|
||||
'language' => 'Türkçe',
|
||||
'location' => fake()->optional()->randomElement(['Kadıköy, İstanbul', 'Tuzla, İstanbul', 'Beşiktaş, İstanbul']),
|
||||
];
|
||||
}
|
||||
}
|
||||
33
database/factories/CourseScheduleFactory.php
Normal file
33
database/factories/CourseScheduleFactory.php
Normal file
@@ -0,0 +1,33 @@
|
||||
<?php
|
||||
|
||||
namespace Database\Factories;
|
||||
|
||||
use App\Models\Course;
|
||||
use App\Models\CourseSchedule;
|
||||
use Illuminate\Database\Eloquent\Factories\Factory;
|
||||
|
||||
/**
|
||||
* @extends Factory<CourseSchedule>
|
||||
*/
|
||||
class CourseScheduleFactory extends Factory
|
||||
{
|
||||
/**
|
||||
* @return array<string, mixed>
|
||||
*/
|
||||
public function definition(): array
|
||||
{
|
||||
$startDate = fake()->dateTimeBetween('+1 week', '+3 months');
|
||||
$endDate = (clone $startDate)->modify('+'.fake()->numberBetween(3, 14).' days');
|
||||
$quota = fake()->numberBetween(10, 30);
|
||||
|
||||
return [
|
||||
'course_id' => Course::factory(),
|
||||
'start_date' => $startDate,
|
||||
'end_date' => $endDate,
|
||||
'location' => fake()->randomElement(['Kadıköy', 'Tuzla', 'Online']),
|
||||
'quota' => $quota,
|
||||
'available_seats' => fake()->numberBetween(0, $quota),
|
||||
'is_urgent' => fake()->boolean(20),
|
||||
];
|
||||
}
|
||||
}
|
||||
34
database/factories/FaqFactory.php
Normal file
34
database/factories/FaqFactory.php
Normal file
@@ -0,0 +1,34 @@
|
||||
<?php
|
||||
|
||||
namespace Database\Factories;
|
||||
|
||||
use App\Enums\FaqCategory;
|
||||
use App\Models\Faq;
|
||||
use Illuminate\Database\Eloquent\Factories\Factory;
|
||||
|
||||
/**
|
||||
* @extends Factory<Faq>
|
||||
*/
|
||||
class FaqFactory extends Factory
|
||||
{
|
||||
/**
|
||||
* @return array<string, mixed>
|
||||
*/
|
||||
public function definition(): array
|
||||
{
|
||||
return [
|
||||
'category' => fake()->randomElement(FaqCategory::cases()),
|
||||
'question' => fake()->sentence().'?',
|
||||
'answer' => fake()->paragraph(),
|
||||
'order_index' => fake()->numberBetween(0, 10),
|
||||
'is_active' => true,
|
||||
];
|
||||
}
|
||||
|
||||
public function inactive(): static
|
||||
{
|
||||
return $this->state(fn (array $attributes) => [
|
||||
'is_active' => false,
|
||||
]);
|
||||
}
|
||||
}
|
||||
28
database/factories/GuideCardFactory.php
Normal file
28
database/factories/GuideCardFactory.php
Normal file
@@ -0,0 +1,28 @@
|
||||
<?php
|
||||
|
||||
namespace Database\Factories;
|
||||
|
||||
use App\Models\GuideCard;
|
||||
use Illuminate\Database\Eloquent\Factories\Factory;
|
||||
|
||||
/**
|
||||
* @extends Factory<GuideCard>
|
||||
*/
|
||||
class GuideCardFactory extends Factory
|
||||
{
|
||||
/**
|
||||
* @return array<string, mixed>
|
||||
*/
|
||||
public function definition(): array
|
||||
{
|
||||
return [
|
||||
'title' => fake()->words(2, true),
|
||||
'description' => fake()->paragraph(),
|
||||
'icon' => fake()->randomElement(['anchor', 'compass', 'shield', 'briefcase', 'ship', 'navigation']),
|
||||
'color' => fake()->randomElement(['from-blue-500 to-blue-700', 'from-emerald-500 to-emerald-700', 'from-orange-500 to-orange-700', 'from-rose-500 to-rose-700']),
|
||||
'link' => '/'.fake()->slug(2),
|
||||
'order' => fake()->numberBetween(0, 10),
|
||||
'is_active' => true,
|
||||
];
|
||||
}
|
||||
}
|
||||
34
database/factories/HeroSlideFactory.php
Normal file
34
database/factories/HeroSlideFactory.php
Normal file
@@ -0,0 +1,34 @@
|
||||
<?php
|
||||
|
||||
namespace Database\Factories;
|
||||
|
||||
use App\Models\HeroSlide;
|
||||
use Illuminate\Database\Eloquent\Factories\Factory;
|
||||
|
||||
/**
|
||||
* @extends Factory<HeroSlide>
|
||||
*/
|
||||
class HeroSlideFactory extends Factory
|
||||
{
|
||||
/**
|
||||
* @return array<string, mixed>
|
||||
*/
|
||||
public function definition(): array
|
||||
{
|
||||
return [
|
||||
'label' => fake()->words(3, true),
|
||||
'title' => fake()->sentence(5),
|
||||
'description' => fake()->paragraph(),
|
||||
'image' => null,
|
||||
'order_index' => fake()->numberBetween(0, 10),
|
||||
'is_active' => true,
|
||||
];
|
||||
}
|
||||
|
||||
public function inactive(): static
|
||||
{
|
||||
return $this->state(fn (array $attributes) => [
|
||||
'is_active' => false,
|
||||
]);
|
||||
}
|
||||
}
|
||||
44
database/factories/LeadFactory.php
Normal file
44
database/factories/LeadFactory.php
Normal file
@@ -0,0 +1,44 @@
|
||||
<?php
|
||||
|
||||
namespace Database\Factories;
|
||||
|
||||
use App\Enums\LeadSource;
|
||||
use App\Enums\LeadStatus;
|
||||
use App\Models\Lead;
|
||||
use Illuminate\Database\Eloquent\Factories\Factory;
|
||||
|
||||
/**
|
||||
* @extends Factory<Lead>
|
||||
*/
|
||||
class LeadFactory extends Factory
|
||||
{
|
||||
/**
|
||||
* @return array<string, mixed>
|
||||
*/
|
||||
public function definition(): array
|
||||
{
|
||||
return [
|
||||
'name' => fake()->name(),
|
||||
'phone' => fake()->phoneNumber(),
|
||||
'target_course' => fake()->optional()->words(2, true),
|
||||
'education_level' => fake()->optional()->randomElement(['Lise', 'Üniversite', 'Lisans', 'Yüksek Lisans']),
|
||||
'subject' => fake()->optional()->randomElement(['stcw', 'kaptanlik', 'belge', 'diger']),
|
||||
'message' => fake()->optional()->paragraph(),
|
||||
'status' => fake()->randomElement(LeadStatus::cases()),
|
||||
'notes' => null,
|
||||
'is_read' => fake()->boolean(30),
|
||||
'source' => fake()->randomElement(LeadSource::cases()),
|
||||
'utm' => null,
|
||||
'consent_kvkk' => true,
|
||||
'consent_text_version' => 'v1.0',
|
||||
];
|
||||
}
|
||||
|
||||
public function unread(): static
|
||||
{
|
||||
return $this->state(fn (array $attributes) => [
|
||||
'is_read' => false,
|
||||
'status' => LeadStatus::New,
|
||||
]);
|
||||
}
|
||||
}
|
||||
30
database/factories/MenuFactory.php
Normal file
30
database/factories/MenuFactory.php
Normal file
@@ -0,0 +1,30 @@
|
||||
<?php
|
||||
|
||||
namespace Database\Factories;
|
||||
|
||||
use App\Enums\MenuLocation;
|
||||
use App\Enums\MenuType;
|
||||
use App\Models\Menu;
|
||||
use Illuminate\Database\Eloquent\Factories\Factory;
|
||||
|
||||
/**
|
||||
* @extends Factory<Menu>
|
||||
*/
|
||||
class MenuFactory extends Factory
|
||||
{
|
||||
/**
|
||||
* @return array<string, mixed>
|
||||
*/
|
||||
public function definition(): array
|
||||
{
|
||||
return [
|
||||
'location' => fake()->randomElement(MenuLocation::cases()),
|
||||
'label' => fake()->words(2, true),
|
||||
'url' => '/'.fake()->slug(2),
|
||||
'type' => MenuType::Link,
|
||||
'parent_id' => null,
|
||||
'order' => fake()->numberBetween(0, 10),
|
||||
'is_active' => true,
|
||||
];
|
||||
}
|
||||
}
|
||||
30
database/factories/PageBlockFactory.php
Normal file
30
database/factories/PageBlockFactory.php
Normal file
@@ -0,0 +1,30 @@
|
||||
<?php
|
||||
|
||||
namespace Database\Factories;
|
||||
|
||||
use App\Models\Page;
|
||||
use App\Models\PageBlock;
|
||||
use Illuminate\Database\Eloquent\Factories\Factory;
|
||||
|
||||
/**
|
||||
* @extends Factory<PageBlock>
|
||||
*/
|
||||
class PageBlockFactory extends Factory
|
||||
{
|
||||
/**
|
||||
* @return array<string, mixed>
|
||||
*/
|
||||
public function definition(): array
|
||||
{
|
||||
return [
|
||||
'page_id' => Page::factory(),
|
||||
'type' => fake()->randomElement(['hero', 'text_image', 'stats_grid', 'cta', 'gallery']),
|
||||
'content' => [
|
||||
'title' => fake()->sentence(3),
|
||||
'text' => fake()->paragraph(),
|
||||
],
|
||||
'order_index' => fake()->numberBetween(0, 10),
|
||||
'is_active' => true,
|
||||
];
|
||||
}
|
||||
}
|
||||
29
database/factories/PageFactory.php
Normal file
29
database/factories/PageFactory.php
Normal file
@@ -0,0 +1,29 @@
|
||||
<?php
|
||||
|
||||
namespace Database\Factories;
|
||||
|
||||
use App\Models\Page;
|
||||
use Illuminate\Database\Eloquent\Factories\Factory;
|
||||
use Illuminate\Support\Str;
|
||||
|
||||
/**
|
||||
* @extends Factory<Page>
|
||||
*/
|
||||
class PageFactory extends Factory
|
||||
{
|
||||
/**
|
||||
* @return array<string, mixed>
|
||||
*/
|
||||
public function definition(): array
|
||||
{
|
||||
$title = fake()->unique()->words(3, true);
|
||||
|
||||
return [
|
||||
'slug' => Str::slug($title),
|
||||
'title' => ucfirst($title),
|
||||
'meta_title' => fake()->sentence(4),
|
||||
'meta_description' => fake()->sentence(10),
|
||||
'is_active' => true,
|
||||
];
|
||||
}
|
||||
}
|
||||
29
database/factories/StoryFactory.php
Normal file
29
database/factories/StoryFactory.php
Normal file
@@ -0,0 +1,29 @@
|
||||
<?php
|
||||
|
||||
namespace Database\Factories;
|
||||
|
||||
use App\Models\Story;
|
||||
use Illuminate\Database\Eloquent\Factories\Factory;
|
||||
|
||||
/**
|
||||
* @extends Factory<Story>
|
||||
*/
|
||||
class StoryFactory extends Factory
|
||||
{
|
||||
/**
|
||||
* @return array<string, mixed>
|
||||
*/
|
||||
public function definition(): array
|
||||
{
|
||||
return [
|
||||
'title' => fake()->sentence(4),
|
||||
'badge' => fake()->randomElement(['Tanıtım', 'Yeni Dönem', null]),
|
||||
'content' => fake()->paragraphs(2, true),
|
||||
'image' => null,
|
||||
'cta_text' => fake()->randomElement(['Detaylı Bilgi', 'Hakkımızda', null]),
|
||||
'cta_url' => fake()->randomElement(['/kurumsal/hakkimizda', '/egitimler', null]),
|
||||
'order_index' => fake()->numberBetween(0, 10),
|
||||
'is_active' => true,
|
||||
];
|
||||
}
|
||||
}
|
||||
45
database/factories/UserFactory.php
Normal file
45
database/factories/UserFactory.php
Normal file
@@ -0,0 +1,45 @@
|
||||
<?php
|
||||
|
||||
namespace Database\Factories;
|
||||
|
||||
use App\Models\User;
|
||||
use Illuminate\Database\Eloquent\Factories\Factory;
|
||||
use Illuminate\Support\Facades\Hash;
|
||||
use Illuminate\Support\Str;
|
||||
|
||||
/**
|
||||
* @extends Factory<User>
|
||||
*/
|
||||
class UserFactory extends Factory
|
||||
{
|
||||
/**
|
||||
* The current password being used by the factory.
|
||||
*/
|
||||
protected static ?string $password;
|
||||
|
||||
/**
|
||||
* Define the model's default state.
|
||||
*
|
||||
* @return array<string, mixed>
|
||||
*/
|
||||
public function definition(): array
|
||||
{
|
||||
return [
|
||||
'name' => fake()->name(),
|
||||
'email' => fake()->unique()->safeEmail(),
|
||||
'email_verified_at' => now(),
|
||||
'password' => static::$password ??= Hash::make('password'),
|
||||
'remember_token' => Str::random(10),
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
* Indicate that the model's email address should be unverified.
|
||||
*/
|
||||
public function unverified(): static
|
||||
{
|
||||
return $this->state(fn (array $attributes) => [
|
||||
'email_verified_at' => null,
|
||||
]);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user