attachments upload

This commit is contained in:
StudioTem committed 2023-02-07 12:29:05 +01:00
1 parent 7cec94337b
commit ed3300ad29
9 files changed
+689 -12

No files matched your search

@@ -2,6 +2,7 @@
namespace App\Http\Controllers;
use App\Models\Attachment;
use App\Models\MasterTask;
use App\Models\SubTask;
use App\Models\Team;
@@ -40,6 +41,12 @@ class SubTaskController extends Controller
$mastertask = MasterTask::find($mastertask_id);
$subtask = $mastertask->subtasks()->create($request->all()['data']);
// upload attachmentu
if ($request->file('data')) {
$attachments = Attachment::uploadAttachmentsToS3($request->file('data')['files'], $mastertask);
$subtask->attachments()->createMany($attachments);
}
return response()->json([
'message' => 'Sub Task created successfully',
'subtask' => $subtask