update deploy
This commit is contained in:
@@ -0,0 +1,20 @@
|
||||
<?php
|
||||
|
||||
namespace App\Repositories\Contracts;
|
||||
|
||||
use App\Models\Announcement;
|
||||
use Illuminate\Pagination\LengthAwarePaginator;
|
||||
|
||||
/**
|
||||
* @extends BaseRepositoryInterface<Announcement>
|
||||
*/
|
||||
interface AnnouncementRepositoryInterface extends BaseRepositoryInterface
|
||||
{
|
||||
public function findBySlug(string $slug): ?Announcement;
|
||||
|
||||
/**
|
||||
* @param array<string, mixed> $filters
|
||||
* @return LengthAwarePaginator<int, Announcement>
|
||||
*/
|
||||
public function paginate(array $filters = [], int $perPage = 15): LengthAwarePaginator;
|
||||
}
|
||||
37
app/Repositories/Contracts/BaseRepositoryInterface.php
Normal file
37
app/Repositories/Contracts/BaseRepositoryInterface.php
Normal file
@@ -0,0 +1,37 @@
|
||||
<?php
|
||||
|
||||
namespace App\Repositories\Contracts;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Pagination\LengthAwarePaginator;
|
||||
|
||||
/**
|
||||
* @template T of Model
|
||||
*/
|
||||
interface BaseRepositoryInterface
|
||||
{
|
||||
/**
|
||||
* @param array<string, mixed> $filters
|
||||
* @return LengthAwarePaginator<int, T>
|
||||
*/
|
||||
public function paginate(array $filters = [], int $perPage = 15): LengthAwarePaginator;
|
||||
|
||||
/**
|
||||
* @return T|null
|
||||
*/
|
||||
public function findById(int $id): ?Model;
|
||||
|
||||
/**
|
||||
* @param array<string, mixed> $data
|
||||
* @return T
|
||||
*/
|
||||
public function create(array $data): Model;
|
||||
|
||||
/**
|
||||
* @param array<string, mixed> $data
|
||||
* @return T
|
||||
*/
|
||||
public function update(Model $model, array $data): Model;
|
||||
|
||||
public function delete(Model $model): bool;
|
||||
}
|
||||
20
app/Repositories/Contracts/CategoryRepositoryInterface.php
Normal file
20
app/Repositories/Contracts/CategoryRepositoryInterface.php
Normal file
@@ -0,0 +1,20 @@
|
||||
<?php
|
||||
|
||||
namespace App\Repositories\Contracts;
|
||||
|
||||
use App\Models\Category;
|
||||
use Illuminate\Pagination\LengthAwarePaginator;
|
||||
|
||||
/**
|
||||
* @extends BaseRepositoryInterface<Category>
|
||||
*/
|
||||
interface CategoryRepositoryInterface extends BaseRepositoryInterface
|
||||
{
|
||||
public function findBySlug(string $slug): ?Category;
|
||||
|
||||
/**
|
||||
* @param array<string, mixed> $filters
|
||||
* @return LengthAwarePaginator<int, Category>
|
||||
*/
|
||||
public function paginate(array $filters = [], int $perPage = 15): LengthAwarePaginator;
|
||||
}
|
||||
24
app/Repositories/Contracts/CommentRepositoryInterface.php
Normal file
24
app/Repositories/Contracts/CommentRepositoryInterface.php
Normal file
@@ -0,0 +1,24 @@
|
||||
<?php
|
||||
|
||||
namespace App\Repositories\Contracts;
|
||||
|
||||
use App\Models\Comment;
|
||||
use Illuminate\Database\Eloquent\Collection;
|
||||
use Illuminate\Pagination\LengthAwarePaginator;
|
||||
|
||||
/**
|
||||
* @extends BaseRepositoryInterface<Comment>
|
||||
*/
|
||||
interface CommentRepositoryInterface extends BaseRepositoryInterface
|
||||
{
|
||||
/**
|
||||
* @param array<string, mixed> $filters
|
||||
* @return LengthAwarePaginator<int, Comment>
|
||||
*/
|
||||
public function paginate(array $filters = [], int $perPage = 15): LengthAwarePaginator;
|
||||
|
||||
/**
|
||||
* @return Collection<int, Comment>
|
||||
*/
|
||||
public function getApprovedByCommentable(string $commentableType, int $commentableId): Collection;
|
||||
}
|
||||
20
app/Repositories/Contracts/CourseRepositoryInterface.php
Normal file
20
app/Repositories/Contracts/CourseRepositoryInterface.php
Normal file
@@ -0,0 +1,20 @@
|
||||
<?php
|
||||
|
||||
namespace App\Repositories\Contracts;
|
||||
|
||||
use App\Models\Course;
|
||||
use Illuminate\Pagination\LengthAwarePaginator;
|
||||
|
||||
/**
|
||||
* @extends BaseRepositoryInterface<Course>
|
||||
*/
|
||||
interface CourseRepositoryInterface extends BaseRepositoryInterface
|
||||
{
|
||||
public function findBySlug(string $slug): ?Course;
|
||||
|
||||
/**
|
||||
* @param array<string, mixed> $filters
|
||||
* @return LengthAwarePaginator<int, Course>
|
||||
*/
|
||||
public function paginate(array $filters = [], int $perPage = 15): LengthAwarePaginator;
|
||||
}
|
||||
25
app/Repositories/Contracts/FaqRepositoryInterface.php
Normal file
25
app/Repositories/Contracts/FaqRepositoryInterface.php
Normal file
@@ -0,0 +1,25 @@
|
||||
<?php
|
||||
|
||||
namespace App\Repositories\Contracts;
|
||||
|
||||
use App\Enums\FaqCategory;
|
||||
use App\Models\Faq;
|
||||
use Illuminate\Database\Eloquent\Collection;
|
||||
use Illuminate\Pagination\LengthAwarePaginator;
|
||||
|
||||
/**
|
||||
* @extends BaseRepositoryInterface<Faq>
|
||||
*/
|
||||
interface FaqRepositoryInterface extends BaseRepositoryInterface
|
||||
{
|
||||
/**
|
||||
* @param array<string, mixed> $filters
|
||||
* @return LengthAwarePaginator<int, Faq>
|
||||
*/
|
||||
public function paginate(array $filters = [], int $perPage = 15): LengthAwarePaginator;
|
||||
|
||||
/**
|
||||
* @return Collection<int, Faq>
|
||||
*/
|
||||
public function getByCategory(FaqCategory $category): Collection;
|
||||
}
|
||||
24
app/Repositories/Contracts/GuideCardRepositoryInterface.php
Normal file
24
app/Repositories/Contracts/GuideCardRepositoryInterface.php
Normal file
@@ -0,0 +1,24 @@
|
||||
<?php
|
||||
|
||||
namespace App\Repositories\Contracts;
|
||||
|
||||
use App\Models\GuideCard;
|
||||
use Illuminate\Database\Eloquent\Collection;
|
||||
use Illuminate\Pagination\LengthAwarePaginator;
|
||||
|
||||
/**
|
||||
* @extends BaseRepositoryInterface<GuideCard>
|
||||
*/
|
||||
interface GuideCardRepositoryInterface extends BaseRepositoryInterface
|
||||
{
|
||||
/**
|
||||
* @param array<string, mixed> $filters
|
||||
* @return LengthAwarePaginator<int, GuideCard>
|
||||
*/
|
||||
public function paginate(array $filters = [], int $perPage = 15): LengthAwarePaginator;
|
||||
|
||||
/**
|
||||
* @return Collection<int, GuideCard>
|
||||
*/
|
||||
public function active(): Collection;
|
||||
}
|
||||
24
app/Repositories/Contracts/HeroSlideRepositoryInterface.php
Normal file
24
app/Repositories/Contracts/HeroSlideRepositoryInterface.php
Normal file
@@ -0,0 +1,24 @@
|
||||
<?php
|
||||
|
||||
namespace App\Repositories\Contracts;
|
||||
|
||||
use App\Models\HeroSlide;
|
||||
use Illuminate\Database\Eloquent\Collection;
|
||||
use Illuminate\Pagination\LengthAwarePaginator;
|
||||
|
||||
/**
|
||||
* @extends BaseRepositoryInterface<HeroSlide>
|
||||
*/
|
||||
interface HeroSlideRepositoryInterface extends BaseRepositoryInterface
|
||||
{
|
||||
/**
|
||||
* @param array<string, mixed> $filters
|
||||
* @return LengthAwarePaginator<int, HeroSlide>
|
||||
*/
|
||||
public function paginate(array $filters = [], int $perPage = 15): LengthAwarePaginator;
|
||||
|
||||
/**
|
||||
* @return Collection<int, HeroSlide>
|
||||
*/
|
||||
public function active(): Collection;
|
||||
}
|
||||
18
app/Repositories/Contracts/LeadRepositoryInterface.php
Normal file
18
app/Repositories/Contracts/LeadRepositoryInterface.php
Normal file
@@ -0,0 +1,18 @@
|
||||
<?php
|
||||
|
||||
namespace App\Repositories\Contracts;
|
||||
|
||||
use App\Models\Lead;
|
||||
use Illuminate\Pagination\LengthAwarePaginator;
|
||||
|
||||
/**
|
||||
* @extends BaseRepositoryInterface<Lead>
|
||||
*/
|
||||
interface LeadRepositoryInterface extends BaseRepositoryInterface
|
||||
{
|
||||
/**
|
||||
* @param array<string, mixed> $filters
|
||||
* @return LengthAwarePaginator<int, Lead>
|
||||
*/
|
||||
public function paginate(array $filters = [], int $perPage = 15): LengthAwarePaginator;
|
||||
}
|
||||
30
app/Repositories/Contracts/MenuRepositoryInterface.php
Normal file
30
app/Repositories/Contracts/MenuRepositoryInterface.php
Normal file
@@ -0,0 +1,30 @@
|
||||
<?php
|
||||
|
||||
namespace App\Repositories\Contracts;
|
||||
|
||||
use App\Enums\MenuLocation;
|
||||
use App\Models\Menu;
|
||||
use Illuminate\Database\Eloquent\Collection;
|
||||
use Illuminate\Pagination\LengthAwarePaginator;
|
||||
|
||||
/**
|
||||
* @extends BaseRepositoryInterface<Menu>
|
||||
*/
|
||||
interface MenuRepositoryInterface extends BaseRepositoryInterface
|
||||
{
|
||||
/**
|
||||
* @param array<string, mixed> $filters
|
||||
* @return LengthAwarePaginator<int, Menu>
|
||||
*/
|
||||
public function paginate(array $filters = [], int $perPage = 15): LengthAwarePaginator;
|
||||
|
||||
/**
|
||||
* @return Collection<int, Menu>
|
||||
*/
|
||||
public function getByLocation(MenuLocation $location): Collection;
|
||||
|
||||
/**
|
||||
* @param array<int, array{id: int, order_index: int, parent_id?: int|null}> $items
|
||||
*/
|
||||
public function reorder(array $items): void;
|
||||
}
|
||||
20
app/Repositories/Contracts/PageRepositoryInterface.php
Normal file
20
app/Repositories/Contracts/PageRepositoryInterface.php
Normal file
@@ -0,0 +1,20 @@
|
||||
<?php
|
||||
|
||||
namespace App\Repositories\Contracts;
|
||||
|
||||
use App\Models\Page;
|
||||
use Illuminate\Pagination\LengthAwarePaginator;
|
||||
|
||||
/**
|
||||
* @extends BaseRepositoryInterface<Page>
|
||||
*/
|
||||
interface PageRepositoryInterface extends BaseRepositoryInterface
|
||||
{
|
||||
public function findBySlug(string $slug): ?Page;
|
||||
|
||||
/**
|
||||
* @param array<string, mixed> $filters
|
||||
* @return LengthAwarePaginator<int, Page>
|
||||
*/
|
||||
public function paginate(array $filters = [], int $perPage = 15): LengthAwarePaginator;
|
||||
}
|
||||
24
app/Repositories/Contracts/ScheduleRepositoryInterface.php
Normal file
24
app/Repositories/Contracts/ScheduleRepositoryInterface.php
Normal file
@@ -0,0 +1,24 @@
|
||||
<?php
|
||||
|
||||
namespace App\Repositories\Contracts;
|
||||
|
||||
use App\Models\CourseSchedule;
|
||||
use Illuminate\Database\Eloquent\Collection;
|
||||
use Illuminate\Pagination\LengthAwarePaginator;
|
||||
|
||||
/**
|
||||
* @extends BaseRepositoryInterface<CourseSchedule>
|
||||
*/
|
||||
interface ScheduleRepositoryInterface extends BaseRepositoryInterface
|
||||
{
|
||||
/**
|
||||
* @param array<string, mixed> $filters
|
||||
* @return LengthAwarePaginator<int, CourseSchedule>
|
||||
*/
|
||||
public function paginate(array $filters = [], int $perPage = 15): LengthAwarePaginator;
|
||||
|
||||
/**
|
||||
* @return Collection<int, CourseSchedule>
|
||||
*/
|
||||
public function upcoming(int $limit = 20): Collection;
|
||||
}
|
||||
51
app/Repositories/Contracts/SettingRepositoryInterface.php
Normal file
51
app/Repositories/Contracts/SettingRepositoryInterface.php
Normal file
@@ -0,0 +1,51 @@
|
||||
<?php
|
||||
|
||||
namespace App\Repositories\Contracts;
|
||||
|
||||
use App\Enums\SettingGroup;
|
||||
use App\Models\Setting;
|
||||
use Illuminate\Database\Eloquent\Collection;
|
||||
|
||||
/**
|
||||
* @extends BaseRepositoryInterface<Setting>
|
||||
*/
|
||||
interface SettingRepositoryInterface extends BaseRepositoryInterface
|
||||
{
|
||||
/**
|
||||
* @return Collection<int, Setting>
|
||||
*/
|
||||
public function all(): Collection;
|
||||
|
||||
/**
|
||||
* Get all public settings grouped by group name (nested key-value format).
|
||||
*
|
||||
* @return array<string, array<string, mixed>>
|
||||
*/
|
||||
public function publicGrouped(): array;
|
||||
|
||||
/**
|
||||
* Get public settings for a single group (key-value format).
|
||||
*
|
||||
* @return array<string, mixed>
|
||||
*/
|
||||
public function publicByGroup(SettingGroup $group): array;
|
||||
|
||||
public function findByKey(string $key): ?Setting;
|
||||
|
||||
/**
|
||||
* @return Collection<int, Setting>
|
||||
*/
|
||||
public function getByGroup(SettingGroup $group): Collection;
|
||||
|
||||
/**
|
||||
* Bulk update settings using dot notation keys (e.g. "general.site_name").
|
||||
*
|
||||
* @param array<string, mixed> $settings
|
||||
*/
|
||||
public function bulkUpdate(array $settings): void;
|
||||
|
||||
/**
|
||||
* Clear all setting caches.
|
||||
*/
|
||||
public function clearCache(): void;
|
||||
}
|
||||
20
app/Repositories/Contracts/UserRepositoryInterface.php
Normal file
20
app/Repositories/Contracts/UserRepositoryInterface.php
Normal file
@@ -0,0 +1,20 @@
|
||||
<?php
|
||||
|
||||
namespace App\Repositories\Contracts;
|
||||
|
||||
use App\Models\User;
|
||||
use Illuminate\Pagination\LengthAwarePaginator;
|
||||
|
||||
/**
|
||||
* @extends BaseRepositoryInterface<User>
|
||||
*/
|
||||
interface UserRepositoryInterface extends BaseRepositoryInterface
|
||||
{
|
||||
/**
|
||||
* @param array<string, mixed> $filters
|
||||
* @return LengthAwarePaginator<int, User>
|
||||
*/
|
||||
public function paginate(array $filters = [], int $perPage = 15): LengthAwarePaginator;
|
||||
|
||||
public function findByEmail(string $email): ?User;
|
||||
}
|
||||
Reference in New Issue
Block a user