feat: move departments from projects to companies
Departments now belong to a Company, not a Project.
- New migration: recreates settings_departments with company_id (migrates existing data)
- Department model: company_id FK, company() relation
- Company model: departments() hasMany relation
- ProjectSetting model: removes departments() relation
- Controller: dept methods now take Company instead of ProjectSetting
- Routes: department CRUD moves to companies/{company}/departments
- View: departments section appears on each company card (purple theme);
project body is now locations-only (single column)
Co-Authored-By: Claude Sonnet 4.6 <[email protected]>
This commit is contained in:
1 parent
9a268dc79b
commit
12e07480a0
7 files changed
+206
-153
No files matched your search
+3
-3
@@ -144,9 +144,9 @@ Route::middleware(['auth', 'verified'])->group(function () {
|
||||
Route::post('settings/projects/{project}/locations', [ProjectSettingController::class, 'storeLocation'])->name('settings.projects.locations.store');
|
||||
Route::patch('settings/projects/{project}/locations/{location}', [ProjectSettingController::class, 'updateLocation'])->name('settings.projects.locations.update');
|
||||
Route::delete('settings/projects/{project}/locations/{location}', [ProjectSettingController::class, 'destroyLocation'])->name('settings.projects.locations.destroy');
|
||||
Route::post('settings/projects/{project}/departments', [ProjectSettingController::class, 'storeDepartment'])->name('settings.projects.departments.store');
|
||||
Route::patch('settings/projects/{project}/departments/{department}', [ProjectSettingController::class, 'updateDepartment'])->name('settings.projects.departments.update');
|
||||
Route::delete('settings/projects/{project}/departments/{department}', [ProjectSettingController::class, 'destroyDepartment'])->name('settings.projects.departments.destroy');
|
||||
Route::post('settings/projects/companies/{company}/departments', [ProjectSettingController::class, 'storeDepartment'])->name('settings.projects.companies.departments.store');
|
||||
Route::patch('settings/projects/companies/{company}/departments/{department}', [ProjectSettingController::class, 'updateDepartment'])->name('settings.projects.companies.departments.update');
|
||||
Route::delete('settings/projects/companies/{company}/departments/{department}', [ProjectSettingController::class, 'destroyDepartment'])->name('settings.projects.companies.departments.destroy');
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
Reference in new issue
Block a user