X7ROOT File Manager
Current Path:
/var/www/html/mpc_kiso/database/migrations
var
/
www
/
html
/
mpc_kiso
/
database
/
migrations
/
📁
..
📄
2014_10_12_000000_create_users_table.php
(781 B)
📄
2014_10_12_100000_create_password_resets_table.php
(715 B)
📄
2017_08_29_064643_create_admins_table.php
(620 B)
📄
2017_09_07_041931_create_employees_table.php
(629 B)
📄
2018_04_02_142137_create_permission_tables.php
(3.19 KB)
📄
2018_04_07_170349_create_audits_table.php
(1.73 KB)
📄
2018_04_16_035112_create_properties_table.php
(632 B)
📄
2018_04_17_035707_create_residents_table.php
(629 B)
📄
2018_04_20_015116_create_bookings_table.php
(626 B)
📄
2018_04_20_135501_base_menu.php
(1.24 KB)
📄
2018_04_26_092349_create_merchants_table.php
(629 B)
📄
2018_04_30_021242_create_agents_table.php
(620 B)
📄
2018_04_30_110901_create_products_table.php
(626 B)
📄
2018_05_18_085338_create_orders_table.php
(620 B)
📄
2018_06_29_002945_create_messagings_table.php
(632 B)
📄
2018_11_11_073711_create_attendances_table.php
(635 B)
📄
2018_11_28_130144_create_reports_table.php
(623 B)
📄
2019_03_20_193639_create_permohonans_table.php
(635 B)
📄
2022_10_01_160457_create_quality_manuals_table.php
(615 B)
📄
2022_10_01_193010_create_open_files_table.php
(600 B)
Editing: 2018_04_02_142137_create_permission_tables.php
<?php use Illuminate\Database\Migrations\Migration; use Illuminate\Database\Schema\Blueprint; class CreatePermissionTables extends Migration { /** * Run the migrations. * * @return void */ public function up() { $tableNames = config('laravel-permission.table_names'); $foreignKeys = config('laravel-permission.foreign_keys'); Schema::create($tableNames['roles'], function (Blueprint $table) { $table->increments('id'); $table->string('name')->unique(); $table->timestamps(); }); Schema::create($tableNames['permissions'], function (Blueprint $table) { $table->increments('id'); $table->string('name')->unique(); $table->timestamps(); }); Schema::create($tableNames['user_has_permissions'], function (Blueprint $table) use ($tableNames, $foreignKeys) { $table->integer($foreignKeys['users'])->unsigned(); $table->integer('permission_id')->unsigned(); $table->foreign($foreignKeys['users']) ->references('id') ->on($tableNames['users']) ->onDelete('cascade'); $table->foreign('permission_id') ->references('id') ->on($tableNames['permissions']) ->onDelete('cascade'); $table->primary([$foreignKeys['users'], 'permission_id']); }); Schema::create($tableNames['user_has_roles'], function (Blueprint $table) use ($tableNames, $foreignKeys) { $table->integer('role_id')->unsigned(); $table->integer($foreignKeys['users'])->unsigned(); $table->foreign('role_id') ->references('id') ->on($tableNames['roles']) ->onDelete('cascade'); $table->foreign($foreignKeys['users']) ->references('id') ->on($tableNames['users']) ->onDelete('cascade'); $table->primary(['role_id', $foreignKeys['users']]); }); Schema::create($tableNames['role_has_permissions'], function (Blueprint $table) use ($tableNames) { $table->integer('permission_id')->unsigned(); $table->integer('role_id')->unsigned(); $table->foreign('permission_id') ->references('id') ->on($tableNames['permissions']) ->onDelete('cascade'); $table->foreign('role_id') ->references('id') ->on($tableNames['roles']) ->onDelete('cascade'); $table->primary(['permission_id', 'role_id']); }); } /** * Reverse the migrations. * * @return void */ public function down() { $tableNames = config('laravel-permission.table_names'); Schema::drop($tableNames['role_has_permissions']); Schema::drop($tableNames['user_has_roles']); Schema::drop($tableNames['user_has_permissions']); Schema::drop($tableNames['roles']); Schema::drop($tableNames['permissions']); } }
Upload File
Create Folder