Change image url to images

This commit is contained in:
2022-02-13 16:49:53 +01:00
parent 767946aaa8
commit 796072e37a
4 changed files with 26 additions and 6 deletions

View File

@@ -8,6 +8,7 @@ use App\Http\Resources\ProjectCollection;
use App\Http\Resources\ProjectResource;
use App\Models\Project;
use App\Repository\Interfaces\ProjectRepository as ProjectRepositoryInterface;
use Illuminate\Support\Carbon;
class ProjectRepository implements ProjectRepositoryInterface
{
@@ -33,4 +34,21 @@ class ProjectRepository implements ProjectRepositoryInterface
return new ProjectResource($project);
}
public function add(array $data)
{
$this->project
->query()
->create([
'title' => $data['title'],
'categories' => $data['categories'],
'author' => $data['author'],
'images' => $data['images'],
'release_date' => Carbon::createFromFormat('Y-d-m', $data['release_date']),
'update_date' => Carbon::createFromFormat('Y-d-m', $data['update_date']),
'project_url' => $data['project_url'],
'project_version' => $data['project_version'],
'description' => $data['description']
]);
}
}