From 9a268dc79bf7db2428254f1388b42bc7ff429333 Mon Sep 17 00:00:00 2001 From: Ghassan Yusuf Date: Tue, 26 May 2026 18:17:50 +0300 Subject: [PATCH] feat: add company reassignment to project edit strip Each project's Edit strip now has a Company dropdown. Changing company and saving moves the project card to the correct company section live without a page reload. Co-Authored-By: Claude Sonnet 4.6 --- .../Settings/ProjectSettingController.php | 15 ++++--- .../views/settings/projects/index.blade.php | 42 +++++++++++++++++-- 2 files changed, 47 insertions(+), 10 deletions(-) diff --git a/app/Http/Controllers/Settings/ProjectSettingController.php b/app/Http/Controllers/Settings/ProjectSettingController.php index a453d72..06e3d89 100644 --- a/app/Http/Controllers/Settings/ProjectSettingController.php +++ b/app/Http/Controllers/Settings/ProjectSettingController.php @@ -70,16 +70,19 @@ class ProjectSettingController extends Controller public function update(Request $request, ProjectSetting $project) { $validated = $request->validate([ - 'name' => 'required|string|max:255|unique:settings_projects,name,' . $project->id, + 'name' => 'required|string|max:255|unique:settings_projects,name,' . $project->id, + 'company_id' => 'nullable|exists:settings_companies,id', ]); $project->update([ - 'name' => $validated['name'], - 'is_active' => $request->boolean('is_active', true), + 'name' => $validated['name'], + 'company_id' => $validated['company_id'] ?? $project->company_id, + 'is_active' => $request->boolean('is_active', true), ]); return response()->json(['project' => [ - 'id' => $project->id, - 'name' => $project->name, - 'is_active' => $project->is_active, + 'id' => $project->id, + 'name' => $project->name, + 'is_active' => $project->is_active, + 'company_id' => $project->company_id, ]]); } diff --git a/resources/views/settings/projects/index.blade.php b/resources/views/settings/projects/index.blade.php index e3012f7..fc653a7 100644 --- a/resources/views/settings/projects/index.blade.php +++ b/resources/views/settings/projects/index.blade.php @@ -213,6 +213,11 @@ $allDeptsJson = json_encode($allDeptsData); {{-- Project edit strip --}}
+