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:
ghassanandClaude Sonnet 4.6 committed 2026-05-26 18:26:27 +03:00
1 parent 9a268dc79b
commit 12e07480a0
7 files changed
+206 -153

No files matched your search

-4
View File
@@ -27,8 +27,4 @@ class ProjectSetting extends Model
return $this->hasMany(\App\Models\Settings\Location::class, 'project_id');
}
public function departments(): \Illuminate\Database\Eloquent\Relations\HasMany
{
return $this->hasMany(\App\Models\Settings\Department::class, 'project_id');
}
}