añadir nuevas funcionalidades
Some checks failed
linter / quality (push) Has been cancelled
tests / ci (push) Has been cancelled

This commit is contained in:
2025-04-30 20:56:28 +02:00
parent 883daf32ed
commit f97a7a8498
27 changed files with 2359 additions and 875 deletions

View File

@@ -47,24 +47,24 @@ class ProjectController extends Controller
{
$validated = $request->validate([
'name' => 'required|string|max:255',
'description' => 'required|string',
'status' => 'required|in:active,inactive',
'team' => 'sometimes|array',
'team.*' => 'exists:users,id',
'description' => 'nullable|string',
'status' => 'required|in:Activo,Inactivo',
//'team' => 'sometimes|array',
//'team.*' => 'exists:users,id',
'project_image' => 'nullable|image|mimes:jpeg,png,jpg,gif|max:2048',
'address' => 'nullable|string|max:255',
'province' => 'nullable|string|max:100',
'country' => 'nullable|string|size:2',
//'country' => 'nullable|string|size:2',
'postal_code' => 'nullable|string|max:10',
'latitude' => 'required|numeric|between:-90,90',
'longitude' => 'required|numeric|between:-180,180',
'icon' => 'nullable|in:'.implode(',', config('project.icons')),
//'icon' => 'nullable|in:'.implode(',', config('project.icons')),
'start_date' => 'nullable|date',
'deadline' => 'nullable|date|after:start_date',
'categories' => 'array|exists:categories,id',
'categories' => 'nullable|array|exists:categories,id',
//'categories' => 'required|array',
'categories.*' => 'exists:categories,id',
'documents.*' => 'file|max:5120|mimes:pdf,docx,xlsx,jpg,png'
//'categories.*' => 'exists:categories,id',
//'documents.*' => 'file|max:5120|mimes:pdf,docx,xlsx,jpg,png'
]);
@@ -98,12 +98,10 @@ class ProjectController extends Controller
}
}
return redirect()->route('projects.show', $project)
->with('success', 'Proyecto creado exitosamente');
return redirect()->route('projects.show', $project)->with('success', 'Proyecto creado exitosamente');
} catch (\Exception $e) {
return back()->withInput()
->with('error', 'Error al crear el proyecto: ' . $e->getMessage());
return back()->withInput()->with('error', 'Error al crear el proyecto: ' . $e->getMessage());
}
}