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,47 @@
<?php
namespace App\Repositories\Eloquent;
use App\Models\CourseSchedule;
use App\Repositories\Contracts\ScheduleRepositoryInterface;
use Illuminate\Database\Eloquent\Collection;
use Illuminate\Pagination\LengthAwarePaginator;
/**
* @extends BaseRepository<CourseSchedule>
*/
class ScheduleRepository extends BaseRepository implements ScheduleRepositoryInterface
{
public function __construct(CourseSchedule $model)
{
parent::__construct($model);
}
/**
* @param array<string, mixed> $filters
* @return LengthAwarePaginator<int, CourseSchedule>
*/
public function paginate(array $filters = [], int $perPage = 15): LengthAwarePaginator
{
$query = $this->model->newQuery()->with('course.category');
if (! empty($filters['course_id'])) {
$query->where('course_id', $filters['course_id']);
}
return $query->orderBy('start_date')->paginate($perPage);
}
/**
* @return Collection<int, CourseSchedule>
*/
public function upcoming(int $limit = 20): Collection
{
return $this->model->newQuery()
->with('course.category')
->where('start_date', '>=', now())
->orderBy('start_date')
->limit($limit)
->get();
}
}