update deploy

This commit is contained in:
bulut
2026-03-27 10:41:54 +03:00
parent 69d19c0176
commit 6f6448aa06
422 changed files with 37956 additions and 0 deletions

View File

@@ -0,0 +1,22 @@
<?php
namespace App\Actions\Announcement;
use App\DTOs\AnnouncementData;
use App\Events\ModelChanged;
use App\Models\Announcement;
use App\Repositories\Contracts\AnnouncementRepositoryInterface;
final class CreateAnnouncementAction
{
public function __construct(private AnnouncementRepositoryInterface $repository) {}
public function execute(AnnouncementData $data): Announcement
{
$result = $this->repository->create($data->toArray());
ModelChanged::dispatch(Announcement::class, 'created');
return $result;
}
}

View File

@@ -0,0 +1,21 @@
<?php
namespace App\Actions\Announcement;
use App\Events\ModelChanged;
use App\Models\Announcement;
use App\Repositories\Contracts\AnnouncementRepositoryInterface;
final class DeleteAnnouncementAction
{
public function __construct(private AnnouncementRepositoryInterface $repository) {}
public function execute(Announcement $announcement): bool
{
$this->repository->delete($announcement);
ModelChanged::dispatch(Announcement::class, 'deleted');
return true;
}
}

View File

@@ -0,0 +1,22 @@
<?php
namespace App\Actions\Announcement;
use App\DTOs\AnnouncementData;
use App\Events\ModelChanged;
use App\Models\Announcement;
use App\Repositories\Contracts\AnnouncementRepositoryInterface;
final class UpdateAnnouncementAction
{
public function __construct(private AnnouncementRepositoryInterface $repository) {}
public function execute(Announcement $announcement, AnnouncementData $data): Announcement
{
$result = $this->repository->update($announcement, $data->toArray());
ModelChanged::dispatch(Announcement::class, 'updated');
return $result;
}
}

View File

@@ -0,0 +1,23 @@
<?php
namespace App\Actions\Category;
use App\DTOs\CategoryData;
use App\Events\ModelChanged;
use App\Models\Category;
use App\Repositories\Contracts\CategoryRepositoryInterface;
class CreateCategoryAction
{
public function __construct(private CategoryRepositoryInterface $repository) {}
public function execute(CategoryData $data): Category
{
/** @var Category */
$result = $this->repository->create($data->toArray());
ModelChanged::dispatch(Category::class, 'created');
return $result;
}
}

View File

@@ -0,0 +1,21 @@
<?php
namespace App\Actions\Category;
use App\Events\ModelChanged;
use App\Models\Category;
use App\Repositories\Contracts\CategoryRepositoryInterface;
class DeleteCategoryAction
{
public function __construct(private CategoryRepositoryInterface $repository) {}
public function execute(Category $category): bool
{
$this->repository->delete($category);
ModelChanged::dispatch(Category::class, 'deleted');
return true;
}
}

View File

@@ -0,0 +1,23 @@
<?php
namespace App\Actions\Category;
use App\DTOs\CategoryData;
use App\Events\ModelChanged;
use App\Models\Category;
use App\Repositories\Contracts\CategoryRepositoryInterface;
class UpdateCategoryAction
{
public function __construct(private CategoryRepositoryInterface $repository) {}
public function execute(Category $category, CategoryData $data): Category
{
/** @var Category */
$result = $this->repository->update($category, $data->toArray());
ModelChanged::dispatch(Category::class, 'updated');
return $result;
}
}

View File

@@ -0,0 +1,22 @@
<?php
namespace App\Actions\Comment;
use App\DTOs\CommentData;
use App\Events\ModelChanged;
use App\Models\Comment;
use App\Repositories\Contracts\CommentRepositoryInterface;
final class CreateCommentAction
{
public function __construct(private CommentRepositoryInterface $repository) {}
public function execute(CommentData $data): Comment
{
$result = $this->repository->create($data->toArray());
ModelChanged::dispatch(Comment::class, 'created');
return $result;
}
}

View File

@@ -0,0 +1,21 @@
<?php
namespace App\Actions\Comment;
use App\Events\ModelChanged;
use App\Models\Comment;
use App\Repositories\Contracts\CommentRepositoryInterface;
final class DeleteCommentAction
{
public function __construct(private CommentRepositoryInterface $repository) {}
public function execute(Comment $comment): bool
{
$this->repository->delete($comment);
ModelChanged::dispatch(Comment::class, 'deleted');
return true;
}
}

View File

@@ -0,0 +1,24 @@
<?php
namespace App\Actions\Comment;
use App\Events\ModelChanged;
use App\Models\Comment;
use App\Repositories\Contracts\CommentRepositoryInterface;
final class UpdateCommentAction
{
public function __construct(private CommentRepositoryInterface $repository) {}
/**
* @param array<string, mixed> $data
*/
public function execute(Comment $comment, array $data): Comment
{
$result = $this->repository->update($comment, $data);
ModelChanged::dispatch(Comment::class, 'updated');
return $result;
}
}

View File

@@ -0,0 +1,23 @@
<?php
namespace App\Actions\Course;
use App\DTOs\CourseData;
use App\Events\ModelChanged;
use App\Models\Course;
use App\Repositories\Contracts\CourseRepositoryInterface;
class CreateCourseAction
{
public function __construct(private CourseRepositoryInterface $repository) {}
public function execute(CourseData $data): Course
{
/** @var Course */
$result = $this->repository->create($data->toArray());
ModelChanged::dispatch(Course::class, 'created');
return $result;
}
}

View File

@@ -0,0 +1,21 @@
<?php
namespace App\Actions\Course;
use App\Events\ModelChanged;
use App\Models\Course;
use App\Repositories\Contracts\CourseRepositoryInterface;
class DeleteCourseAction
{
public function __construct(private CourseRepositoryInterface $repository) {}
public function execute(Course $course): bool
{
$this->repository->delete($course);
ModelChanged::dispatch(Course::class, 'deleted');
return true;
}
}

View File

@@ -0,0 +1,23 @@
<?php
namespace App\Actions\Course;
use App\DTOs\CourseData;
use App\Events\ModelChanged;
use App\Models\Course;
use App\Repositories\Contracts\CourseRepositoryInterface;
class UpdateCourseAction
{
public function __construct(private CourseRepositoryInterface $repository) {}
public function execute(Course $course, CourseData $data): Course
{
/** @var Course */
$result = $this->repository->update($course, $data->toArray());
ModelChanged::dispatch(Course::class, 'updated');
return $result;
}
}

View File

@@ -0,0 +1,22 @@
<?php
namespace App\Actions\Faq;
use App\DTOs\FaqData;
use App\Events\ModelChanged;
use App\Models\Faq;
use App\Repositories\Contracts\FaqRepositoryInterface;
final class CreateFaqAction
{
public function __construct(private FaqRepositoryInterface $repository) {}
public function execute(FaqData $data): Faq
{
$result = $this->repository->create($data->toArray());
ModelChanged::dispatch(Faq::class, 'created');
return $result;
}
}

View File

@@ -0,0 +1,21 @@
<?php
namespace App\Actions\Faq;
use App\Events\ModelChanged;
use App\Models\Faq;
use App\Repositories\Contracts\FaqRepositoryInterface;
final class DeleteFaqAction
{
public function __construct(private FaqRepositoryInterface $repository) {}
public function execute(Faq $faq): bool
{
$this->repository->delete($faq);
ModelChanged::dispatch(Faq::class, 'deleted');
return true;
}
}

View File

@@ -0,0 +1,22 @@
<?php
namespace App\Actions\Faq;
use App\DTOs\FaqData;
use App\Events\ModelChanged;
use App\Models\Faq;
use App\Repositories\Contracts\FaqRepositoryInterface;
final class UpdateFaqAction
{
public function __construct(private FaqRepositoryInterface $repository) {}
public function execute(Faq $faq, FaqData $data): Faq
{
$result = $this->repository->update($faq, $data->toArray());
ModelChanged::dispatch(Faq::class, 'updated');
return $result;
}
}

View File

@@ -0,0 +1,22 @@
<?php
namespace App\Actions\GuideCard;
use App\DTOs\GuideCardData;
use App\Events\ModelChanged;
use App\Models\GuideCard;
use App\Repositories\Contracts\GuideCardRepositoryInterface;
final class CreateGuideCardAction
{
public function __construct(private GuideCardRepositoryInterface $repository) {}
public function execute(GuideCardData $data): GuideCard
{
$result = $this->repository->create($data->toArray());
ModelChanged::dispatch(GuideCard::class, 'created');
return $result;
}
}

View File

@@ -0,0 +1,21 @@
<?php
namespace App\Actions\GuideCard;
use App\Events\ModelChanged;
use App\Models\GuideCard;
use App\Repositories\Contracts\GuideCardRepositoryInterface;
final class DeleteGuideCardAction
{
public function __construct(private GuideCardRepositoryInterface $repository) {}
public function execute(GuideCard $guideCard): bool
{
$this->repository->delete($guideCard);
ModelChanged::dispatch(GuideCard::class, 'deleted');
return true;
}
}

View File

@@ -0,0 +1,22 @@
<?php
namespace App\Actions\GuideCard;
use App\DTOs\GuideCardData;
use App\Events\ModelChanged;
use App\Models\GuideCard;
use App\Repositories\Contracts\GuideCardRepositoryInterface;
final class UpdateGuideCardAction
{
public function __construct(private GuideCardRepositoryInterface $repository) {}
public function execute(GuideCard $guideCard, GuideCardData $data): GuideCard
{
$result = $this->repository->update($guideCard, $data->toArray());
ModelChanged::dispatch(GuideCard::class, 'updated');
return $result;
}
}

View File

@@ -0,0 +1,22 @@
<?php
namespace App\Actions\HeroSlide;
use App\DTOs\HeroSlideData;
use App\Events\ModelChanged;
use App\Models\HeroSlide;
use App\Repositories\Contracts\HeroSlideRepositoryInterface;
final class CreateHeroSlideAction
{
public function __construct(private HeroSlideRepositoryInterface $repository) {}
public function execute(HeroSlideData $data): HeroSlide
{
$result = $this->repository->create($data->toArray());
ModelChanged::dispatch(HeroSlide::class, 'created');
return $result;
}
}

View File

@@ -0,0 +1,21 @@
<?php
namespace App\Actions\HeroSlide;
use App\Events\ModelChanged;
use App\Models\HeroSlide;
use App\Repositories\Contracts\HeroSlideRepositoryInterface;
final class DeleteHeroSlideAction
{
public function __construct(private HeroSlideRepositoryInterface $repository) {}
public function execute(HeroSlide $heroSlide): bool
{
$this->repository->delete($heroSlide);
ModelChanged::dispatch(HeroSlide::class, 'deleted');
return true;
}
}

View File

@@ -0,0 +1,22 @@
<?php
namespace App\Actions\HeroSlide;
use App\DTOs\HeroSlideData;
use App\Events\ModelChanged;
use App\Models\HeroSlide;
use App\Repositories\Contracts\HeroSlideRepositoryInterface;
final class UpdateHeroSlideAction
{
public function __construct(private HeroSlideRepositoryInterface $repository) {}
public function execute(HeroSlide $heroSlide, HeroSlideData $data): HeroSlide
{
$result = $this->repository->update($heroSlide, $data->toArray());
ModelChanged::dispatch(HeroSlide::class, 'updated');
return $result;
}
}

View File

@@ -0,0 +1,22 @@
<?php
namespace App\Actions\Lead;
use App\DTOs\LeadData;
use App\Events\ModelChanged;
use App\Models\Lead;
use App\Repositories\Contracts\LeadRepositoryInterface;
final class CreateLeadAction
{
public function __construct(private LeadRepositoryInterface $repository) {}
public function execute(LeadData $data): Lead
{
$result = $this->repository->create($data->toArray());
ModelChanged::dispatch(Lead::class, 'created');
return $result;
}
}

View File

@@ -0,0 +1,21 @@
<?php
namespace App\Actions\Lead;
use App\Events\ModelChanged;
use App\Models\Lead;
use App\Repositories\Contracts\LeadRepositoryInterface;
final class DeleteLeadAction
{
public function __construct(private LeadRepositoryInterface $repository) {}
public function execute(Lead $lead): bool
{
$this->repository->delete($lead);
ModelChanged::dispatch(Lead::class, 'deleted');
return true;
}
}

View File

@@ -0,0 +1,22 @@
<?php
namespace App\Actions\Lead;
use App\DTOs\LeadData;
use App\Events\ModelChanged;
use App\Models\Lead;
use App\Repositories\Contracts\LeadRepositoryInterface;
final class UpdateLeadAction
{
public function __construct(private LeadRepositoryInterface $repository) {}
public function execute(Lead $lead, LeadData $data): Lead
{
$result = $this->repository->update($lead, $data->toArray());
ModelChanged::dispatch(Lead::class, 'updated');
return $result;
}
}

View File

@@ -0,0 +1,22 @@
<?php
namespace App\Actions\Menu;
use App\DTOs\MenuData;
use App\Events\ModelChanged;
use App\Models\Menu;
use App\Repositories\Contracts\MenuRepositoryInterface;
final class CreateMenuAction
{
public function __construct(private MenuRepositoryInterface $repository) {}
public function execute(MenuData $data): Menu
{
$result = $this->repository->create($data->toArray());
ModelChanged::dispatch(Menu::class, 'created');
return $result;
}
}

View File

@@ -0,0 +1,21 @@
<?php
namespace App\Actions\Menu;
use App\Events\ModelChanged;
use App\Models\Menu;
use App\Repositories\Contracts\MenuRepositoryInterface;
final class DeleteMenuAction
{
public function __construct(private MenuRepositoryInterface $repository) {}
public function execute(Menu $menu): bool
{
$this->repository->delete($menu);
ModelChanged::dispatch(Menu::class, 'deleted');
return true;
}
}

View File

@@ -0,0 +1,22 @@
<?php
namespace App\Actions\Menu;
use App\DTOs\MenuData;
use App\Events\ModelChanged;
use App\Models\Menu;
use App\Repositories\Contracts\MenuRepositoryInterface;
final class UpdateMenuAction
{
public function __construct(private MenuRepositoryInterface $repository) {}
public function execute(Menu $menu, MenuData $data): Menu
{
$result = $this->repository->update($menu, $data->toArray());
ModelChanged::dispatch(Menu::class, 'updated');
return $result;
}
}

View File

@@ -0,0 +1,22 @@
<?php
namespace App\Actions\Page;
use App\DTOs\PageData;
use App\Events\ModelChanged;
use App\Models\Page;
use App\Repositories\Contracts\PageRepositoryInterface;
final class CreatePageAction
{
public function __construct(private PageRepositoryInterface $repository) {}
public function execute(PageData $data): Page
{
$result = $this->repository->create($data->toArray());
ModelChanged::dispatch(Page::class, 'created');
return $result;
}
}

View File

@@ -0,0 +1,21 @@
<?php
namespace App\Actions\Page;
use App\Events\ModelChanged;
use App\Models\Page;
use App\Repositories\Contracts\PageRepositoryInterface;
final class DeletePageAction
{
public function __construct(private PageRepositoryInterface $repository) {}
public function execute(Page $page): bool
{
$this->repository->delete($page);
ModelChanged::dispatch(Page::class, 'deleted');
return true;
}
}

View File

@@ -0,0 +1,22 @@
<?php
namespace App\Actions\Page;
use App\DTOs\PageData;
use App\Events\ModelChanged;
use App\Models\Page;
use App\Repositories\Contracts\PageRepositoryInterface;
final class UpdatePageAction
{
public function __construct(private PageRepositoryInterface $repository) {}
public function execute(Page $page, PageData $data): Page
{
$result = $this->repository->update($page, $data->toArray());
ModelChanged::dispatch(Page::class, 'updated');
return $result;
}
}

View File

@@ -0,0 +1,22 @@
<?php
namespace App\Actions\Schedule;
use App\DTOs\ScheduleData;
use App\Events\ModelChanged;
use App\Models\CourseSchedule;
use App\Repositories\Contracts\ScheduleRepositoryInterface;
final class CreateScheduleAction
{
public function __construct(private ScheduleRepositoryInterface $repository) {}
public function execute(ScheduleData $data): CourseSchedule
{
$result = $this->repository->create($data->toArray());
ModelChanged::dispatch(CourseSchedule::class, 'created');
return $result;
}
}

View File

@@ -0,0 +1,21 @@
<?php
namespace App\Actions\Schedule;
use App\Events\ModelChanged;
use App\Models\CourseSchedule;
use App\Repositories\Contracts\ScheduleRepositoryInterface;
final class DeleteScheduleAction
{
public function __construct(private ScheduleRepositoryInterface $repository) {}
public function execute(CourseSchedule $schedule): bool
{
$this->repository->delete($schedule);
ModelChanged::dispatch(CourseSchedule::class, 'deleted');
return true;
}
}

View File

@@ -0,0 +1,22 @@
<?php
namespace App\Actions\Schedule;
use App\DTOs\ScheduleData;
use App\Events\ModelChanged;
use App\Models\CourseSchedule;
use App\Repositories\Contracts\ScheduleRepositoryInterface;
final class UpdateScheduleAction
{
public function __construct(private ScheduleRepositoryInterface $repository) {}
public function execute(CourseSchedule $schedule, ScheduleData $data): CourseSchedule
{
$result = $this->repository->update($schedule, $data->toArray());
ModelChanged::dispatch(CourseSchedule::class, 'updated');
return $result;
}
}

View File

@@ -0,0 +1,22 @@
<?php
namespace App\Actions\Setting;
use App\Events\ModelChanged;
use App\Models\Setting;
use App\Repositories\Contracts\SettingRepositoryInterface;
final class UpdateSettingsAction
{
public function __construct(private SettingRepositoryInterface $repository) {}
/**
* @param array<string, mixed> $settings
*/
public function execute(array $settings): void
{
$this->repository->bulkUpdate($settings);
ModelChanged::dispatch(Setting::class, 'updated');
}
}

View File

@@ -0,0 +1,29 @@
<?php
namespace App\Actions\User;
use App\DTOs\UserData;
use App\Events\ModelChanged;
use App\Models\User;
use App\Repositories\Contracts\UserRepositoryInterface;
class CreateUserAction
{
public function __construct(private UserRepositoryInterface $repository) {}
public function execute(UserData $data): User
{
/** @var User */
$user = $this->repository->create($data->toArray());
if ($data->role) {
$user->syncRoles([$data->role]);
}
$user->load('roles');
ModelChanged::dispatch(User::class, 'created');
return $user;
}
}

View File

@@ -0,0 +1,21 @@
<?php
namespace App\Actions\User;
use App\Events\ModelChanged;
use App\Models\User;
use App\Repositories\Contracts\UserRepositoryInterface;
class DeleteUserAction
{
public function __construct(private UserRepositoryInterface $repository) {}
public function execute(User $user): bool
{
$this->repository->delete($user);
ModelChanged::dispatch(User::class, 'deleted');
return true;
}
}

View File

@@ -0,0 +1,29 @@
<?php
namespace App\Actions\User;
use App\DTOs\UserData;
use App\Events\ModelChanged;
use App\Models\User;
use App\Repositories\Contracts\UserRepositoryInterface;
class UpdateUserAction
{
public function __construct(private UserRepositoryInterface $repository) {}
public function execute(User $user, UserData $data): User
{
/** @var User */
$user = $this->repository->update($user, $data->toArray());
if ($data->role !== null) {
$user->syncRoles([$data->role]);
}
$user->load('roles');
ModelChanged::dispatch(User::class, 'updated');
return $user;
}
}