añadir nuevas funcionalidades
This commit is contained in:
@@ -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());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user