feat: add Projects settings with sub-locations and cascading dropdowns in purchase request modal
- Migration: add project_id FK to settings_locations - Models: ProjectSetting hasMany Location, Location belongsTo ProjectSetting - Settings: /settings/projects page — manage projects and their sub-locations (two-panel UI) - Sidebar: Projects nav item under Settings group - Routes: 7 new settings/projects routes (Admin only) - Modal: project_name and location fields now cascading dropdowns populated from settings_projects/settings_locations Co-Authored-By: Claude Sonnet 4.6 <[email protected]>
This commit is contained in:
1 parent
75e4890a08
commit
7f8ae898d5
9 files changed
+696
-4
No files matched your search
@@ -0,0 +1,30 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
return new class extends Migration
|
||||
{
|
||||
public function up(): void
|
||||
{
|
||||
Schema::table('settings_locations', function (Blueprint $table) {
|
||||
$table->foreignId('project_id')
|
||||
->nullable()
|
||||
->after('name')
|
||||
->constrained('settings_projects')
|
||||
->nullOnDelete();
|
||||
|
||||
$table->index('project_id');
|
||||
});
|
||||
}
|
||||
|
||||
public function down(): void
|
||||
{
|
||||
Schema::table('settings_locations', function (Blueprint $table) {
|
||||
$table->dropIndex(['project_id']);
|
||||
$table->dropForeign(['project_id']);
|
||||
$table->dropColumn('project_id');
|
||||
});
|
||||
}
|
||||
};
|
||||
Reference in new issue
Block a user