This commit is contained in:
2026-10-20 10:26:45 +03:30
parent 4d0f0f8c8d
commit a5f3b3b4b3
8 changed files with 377 additions and 2 deletions
@@ -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
{
if (!Schema::hasTable('users') || Schema::hasColumn('users', 'page_access')) {
return;
}
Schema::table('users', function (Blueprint $table) {
$table->json('page_access')->nullable()->comment('null=دسترسی کامل؛ در غیر این صورت مشاهده/ویرایش/حذف هر صفحه');
});
}
public function down(): void
{
if (!Schema::hasTable('users') || !Schema::hasColumn('users', 'page_access')) {
return;
}
Schema::table('users', function (Blueprint $table) {
$table->dropColumn('page_access');
});
}
};