feat: add source breath template
This commit is contained in:
@@ -19,6 +19,7 @@ public function createTemplate(Request $request)
|
||||
'duration' => 'sometimes|integer|min:0',
|
||||
'description' => 'sometimes|string|nullable',
|
||||
'image_id' => 'nullable|exists:images,id',
|
||||
'source' => 'nullable|string'
|
||||
]);
|
||||
|
||||
$template = BreathingTemplate::create([
|
||||
@@ -30,6 +31,7 @@ public function createTemplate(Request $request)
|
||||
'duration'=> $data['duration'] ?? 60,
|
||||
'description' => $data['description'] ?? null,
|
||||
'image_id' => $data['image_id'] ?? null,
|
||||
'source' => 'nullable|string'
|
||||
]);
|
||||
|
||||
return response()->json(['message' => 'Template created', 'template' => $template->load('image')]);
|
||||
@@ -49,6 +51,7 @@ public function updateTemplate(Request $request, $id)
|
||||
'duration' => 'sometimes|integer|min:0',
|
||||
'description' => 'sometimes|string|nullable',
|
||||
'image_id' => 'nullable|exists:images,id',
|
||||
'source' => 'nullable|string'
|
||||
]);
|
||||
|
||||
$template->update($data);
|
||||
|
||||
Reference in New Issue
Block a user