First commit for project

This commit is contained in:
2022-02-13 11:19:29 +01:00
commit d9c8d55505
106 changed files with 47789 additions and 0 deletions

View File

@@ -0,0 +1,37 @@
<?php
declare(strict_types=1);
namespace App\Repository;
use App\Http\Resources\ProjectCollection;
use App\Http\Resources\ProjectResource;
use App\Models\Project;
use App\Repository\Interfaces\ProjectRepository as ProjectRepositoryInterface;
class ProjectRepository implements ProjectRepositoryInterface
{
public function __construct(
private Project $project
) {}
public function all()
{
$project = $this->project
->query()
->orderBy('release_data', 'ASC')
->get();
return (new ProjectCollection($project))->collection;
}
public function get(int $id)
{
$project = $this->project
->query()
->find($id)
->first();
return new ProjectResource($project);
}
}