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,38 @@
<?php
namespace App\Repositories\Eloquent;
use App\Models\Category;
use App\Repositories\Contracts\CategoryRepositoryInterface;
use Illuminate\Pagination\LengthAwarePaginator;
/**
* @extends BaseRepository<Category>
*/
class CategoryRepository extends BaseRepository implements CategoryRepositoryInterface
{
public function __construct(Category $model)
{
parent::__construct($model);
}
public function findBySlug(string $slug): ?Category
{
return $this->model->newQuery()->with('menuCourses')->where('slug', $slug)->first();
}
/**
* @param array<string, mixed> $filters
* @return LengthAwarePaginator<int, Category>
*/
public function paginate(array $filters = [], int $perPage = 15): LengthAwarePaginator
{
$query = $this->model->newQuery()->with('menuCourses');
if (! empty($filters['search'])) {
$query->where('label', 'like', '%'.$filters['search'].'%');
}
return $query->latest()->paginate($perPage);
}
}