diff --git a/app/Console/Commands/CreateAdmin.php b/app/Console/Commands/CreateAdmin.php index 2eba22d..56affbe 100644 --- a/app/Console/Commands/CreateAdmin.php +++ b/app/Console/Commands/CreateAdmin.php @@ -36,6 +36,7 @@ class CreateAdmin extends Command if ($user) { $user->password = Hash::make($password); $user->level = 'Admin'; + $user->permissions = 'users,languages,contents,new,fields,search,ALL PRIVILEGES'; $user->save(); $status = 'updated'; } else { @@ -44,6 +45,7 @@ class CreateAdmin extends Command $user->email = $email; $user->password = Hash::make($password); $user->level = 'Admin'; + $user->permissions = 'users,languages,contents,new,fields,search,ALL PRIVILEGES'; $user->save(); $status = 'created'; } diff --git a/database/migrations/2026_04_28_214700_add_default_types.php b/database/migrations/2026_04_28_214700_add_default_types.php new file mode 100644 index 0000000..8042107 --- /dev/null +++ b/database/migrations/2026_04_28_214700_add_default_types.php @@ -0,0 +1,161 @@ + 'Settings', + 'slug' => 'settings', + 'icon' => 'setting', + 'kid' => null, + 's' => 101, + 'full_control' => '1,', + 'write' => '1,24,2,3,7,8,10,13,19', + 'read' => '1,24,2,3,7,8,10,13,19,22,23,26', + 'modify' => '1,2,3,7,8,10,13', + ], + [ + 'title' => 'General Settings', + 'slug' => 'general-settings', + 'icon' => 'setting', + 'kid' => 'settings', + 's' => 0, + 'full_control' => '1', + 'write' => '1,2,13', + 'read' => '1,2,3,8', + 'modify' => '1,2', + ], + [ + 'title' => 'Batch Excel', + 'slug' => 'batch-excel', + 'icon' => 'batch-processing', + 'kid' => 'settings', + 's' => null, + 'full_control' => '1,7', + 'write' => '1,2,3,7,8,13,19', + 'read' => '1,24,2,3,7,8,10,12,13,19,22,23,26', + 'modify' => '1,2,3,7,8,10,12,13,19', + ], + [ + 'title' => 'Document Manager', + 'slug' => 'document-manager', + 'icon' => 'folder-management', + 'kid' => 'documentation', + 's' => 103, + 'full_control' => '1', + 'write' => '1,24,2,8,12,14,22', + 'read' => '1,24,2,3,7,8,9,10,12,13,14,19,22,23', + 'modify' => '1,2,3,7,8,12,13,14,19,22', + ], + [ + 'title' => 'Document Templates', + 'slug' => 'document-templates', + 'icon' => 'document-template', + 'kid' => 'settings', + 's' => null, + 'full_control' => '1', + 'write' => '1,24,2', + 'read' => '1,24,2,8,12', + 'modify' => '1,2', + ], + [ + 'title' => 'Predefined Variables', + 'slug' => 'predefined-variables', + 'icon' => 'setting', + 'kid' => 'settings', + 's' => 3, + 'full_control' => '1', + 'write' => '1,2,3', + 'read' => '1,2,3', + 'modify' => '1,2,3', + ], + [ + 'title' => 'System Information', + 'slug' => 'system-information', + 'icon' => 'system-cloud', + 'kid' => null, + 's' => 106, + 'full_control' => '1', + 'write' => '1', + 'read' => '1', + 'modify' => '1', + ], + [ + 'title' => 'Languages', + 'slug' => 'languages', + 'icon' => 'languages', + 'kid' => null, + 's' => 150, + 'full_control' => '1,', + 'write' => '1,', + 'read' => '1,24', + 'modify' => '1,', + ], + [ + 'title' => 'Report Builder', + 'slug' => 'report-builder', + 'icon' => 'reportbuilder', + 'kid' => 'documentation', + 's' => 2, + 'full_control' => '1,', + 'write' => '1,24,2,7,8,12,14,19,22,26', + 'read' => '1,24,2,7,8,12,14,19,22,23,26', + 'modify' => '1,2,7,8,12,14,19,22,26', + ], + [ + 'title' => 'My Notifications', + 'slug' => 'my-notifications', + 'icon' => 'notification', + 'kid' => null, + 's' => 99, + 'full_control' => '1', + 'write' => '1,24,2,7,17,19', + 'read' => '1,24,2,7,9,14,17,19,22,26', + 'modify' => '1,24,2,7,14,19', + ], + ]; + + foreach ($types as $type) { + DB::table('types')->updateOrInsert( + ['slug' => $type['slug']], + array_merge($type, [ + 'created_at' => now(), + 'updated_at' => now(), + 'enabled' => 1, + 'is_mobile' => 0, + ]) + ); + } + } + + /** + * Reverse the migrations. + */ + public function down(): void + { + $slugs = [ + 'settings', + 'general-settings', + 'batch-excel', + 'document-manager', + 'document-templates', + 'predefined-variables', + 'system-information', + 'languages', + 'report-builder', + 'my-notifications', + ]; + + DB::table('types')->whereIn('slug', $slugs)->delete(); + } +}; diff --git a/database/migrations/2026_04_28_215500_add_user_levels.php b/database/migrations/2026_04_28_215500_add_user_levels.php new file mode 100644 index 0000000..5384144 --- /dev/null +++ b/database/migrations/2026_04_28_215500_add_user_levels.php @@ -0,0 +1,70 @@ +updateOrInsert( + ['id' => $level[0]], + [ + 'created_at' => $level[1], + 'updated_at' => $level[2], + 'title' => $level[3], + 'level_index' => $level[4], + 'full_control' => $level[5], + 'write' => $level[6], + 'read' => $level[7], + 'modify' => $level[8], + 'description' => $level[9], + ] + ); + } + } + + /** + * Reverse the migrations. + */ + public function down(): void + { + DB::table('user_levels')->truncate(); + } +}; diff --git a/database/migrations/2026_04_28_215800_create_column_descriptions_table.php b/database/migrations/2026_04_28_215800_create_column_descriptions_table.php new file mode 100644 index 0000000..3548619 --- /dev/null +++ b/database/migrations/2026_04_28_215800_create_column_descriptions_table.php @@ -0,0 +1,32 @@ +id(); + $table->timestamps(); + $table->string('module_name', 100)->nullable(); + $table->string('column_name', 100)->nullable(); + $table->string('description', 100)->nullable(); + }); + } + } + + /** + * Reverse the migrations. + */ + public function down(): void + { + Schema::dropIfExists('column_descriptions'); + } +};