Skip to content

Commit

Permalink
fix gallery upload
Browse files Browse the repository at this point in the history
  • Loading branch information
gheorghelupu17 committed Oct 17, 2023
1 parent 91cc19a commit 26f91f7
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 2 deletions.
2 changes: 2 additions & 0 deletions app/Http/Controllers/Dashboard/ProjectController.php
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ public function store(StoreRequest $request)
{
$data = $request->validated();
$project = (new ProjectService(Project::class))->create($data);

return redirect()->route('dashboard.projects.edit', $project->id)->with('success', 'Project created.');
}

Expand Down Expand Up @@ -114,6 +115,7 @@ public function changeStatus($id, Request $request)
]
)->validate();
(new ProjectService(Project::class))->changeStatus($project, $request->get('status'));

return redirect()->back()
->with('success', 'Project status changed.');
}
Expand Down
4 changes: 2 additions & 2 deletions app/Http/Requests/Project/StoreRequest.php
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,8 @@ public function rules(): array
'external_links' => ['nullable', 'array'],
'external_links.*' => ['nullable', 'url'],
'is_national' => ['boolean', 'nullable'],
'file_group' => ['array', 'nullable'],
'file_group.*.file' => ['file', 'nullable'],
'gallery' => ['array', 'nullable'],
'gallery.*.file' => ['file', 'nullable'],
'preview' => ['file', 'nullable'],
];
}
Expand Down
1 change: 1 addition & 0 deletions app/Services/ProjectService.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ public function create(array $data): Project|RegionalProject
{
$data['organization_id'] = auth()->user()->organization_id;
$data['status'] = ProjectStatus::draft->value;
// dd($data);
$project = $this->createDraftProject($data);
if (! empty($data['categories'])) {
$project->categories()->attach($data['categories']);
Expand Down

0 comments on commit 26f91f7

Please sign in to comment.