Change image url to images
This commit is contained in:
@@ -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']
|
||||
]);
|
||||
}
|
||||
|
||||
}
|
||||
|
Reference in New Issue
Block a user