diff --git a/app/Http/Controllers/User/PenelitiAsingController.php b/app/Http/Controllers/User/PenelitiAsingController.php index d206a14..2c3945f 100644 --- a/app/Http/Controllers/User/PenelitiAsingController.php +++ b/app/Http/Controllers/User/PenelitiAsingController.php @@ -15,6 +15,7 @@ class PenelitiAsingController extends Controller public function index() { // + return view('user.penelitiasing.index'); } /** diff --git a/database/migrations/2014_10_12_000000_create_users_table.php b/database/migrations/2014_10_12_000000_create_users_table.php index dfad67b..7402ce9 100644 --- a/database/migrations/2014_10_12_000000_create_users_table.php +++ b/database/migrations/2014_10_12_000000_create_users_table.php @@ -14,7 +14,8 @@ class CreateUsersTable extends Migration public function up() { Schema::create('users', function (Blueprint $table) { - $table->id(); + //$table->id(); + $table->uuid('id'); $table->string('name'); $table->string('email')->unique(); $table->timestamp('email_verified_at')->nullable(); diff --git a/database/migrations/2021_04_14_044505_create_sessions_table.php b/database/migrations/2021_04_14_044505_create_sessions_table.php index 88b4a31..32145ed 100644 --- a/database/migrations/2021_04_14_044505_create_sessions_table.php +++ b/database/migrations/2021_04_14_044505_create_sessions_table.php @@ -15,7 +15,7 @@ class CreateSessionsTable extends Migration { Schema::create('sessions', function (Blueprint $table) { $table->string('id')->primary(); - $table->foreignId('user_id')->nullable()->index(); + $table->foreignUuid('user_id')->nullable()->index(); $table->string('ip_address', 45)->nullable(); $table->text('user_agent')->nullable(); $table->text('payload'); diff --git a/database/migrations/2021_04_14_053321_create_permission_tables.php b/database/migrations/2021_04_14_053321_create_permission_tables.php index edf92e7..ab87383 100644 --- a/database/migrations/2021_04_14_053321_create_permission_tables.php +++ b/database/migrations/2021_04_14_053321_create_permission_tables.php @@ -1,8 +1,8 @@ <?php -use Illuminate\Support\Facades\Schema; -use Illuminate\Database\Schema\Blueprint; use Illuminate\Database\Migrations\Migration; +use Illuminate\Database\Schema\Blueprint; +use Illuminate\Support\Facades\Schema; class CreatePermissionTables extends Migration { @@ -21,28 +21,32 @@ class CreatePermissionTables extends Migration } Schema::create($tableNames['permissions'], function (Blueprint $table) { - $table->bigIncrements('id'); - $table->string('name'); // For MySQL 8.0 use string('name', 125); - $table->string('guard_name'); // For MySQL 8.0 use string('guard_name', 125); + // $table->bigIncrements('id'); + $table->uuid('id'); + $table->string('name'); + $table->string('guard_name'); $table->timestamps(); - $table->unique(['name', 'guard_name']); + $table->primary('id'); }); Schema::create($tableNames['roles'], function (Blueprint $table) { - $table->bigIncrements('id'); - $table->string('name'); // For MySQL 8.0 use string('name', 125); - $table->string('guard_name'); // For MySQL 8.0 use string('guard_name', 125); + // $table->bigIncrements('id'); + $table->uuid('id'); + $table->string('name'); + $table->string('guard_name'); $table->timestamps(); - $table->unique(['name', 'guard_name']); + $table->primary('id'); }); Schema::create($tableNames['model_has_permissions'], function (Blueprint $table) use ($tableNames, $columnNames) { - $table->unsignedBigInteger('permission_id'); + // $table->unsignedBigInteger('permission_id'); + $table->uuid('permission_id'); $table->string('model_type'); - $table->unsignedBigInteger($columnNames['model_morph_key']); + // $table->unsignedBigInteger($columnNames['model_morph_key']); + $table->uuid($columnNames['model_morph_key']); $table->index([$columnNames['model_morph_key'], 'model_type'], 'model_has_permissions_model_id_model_type_index'); $table->foreign('permission_id') @@ -50,15 +54,19 @@ class CreatePermissionTables extends Migration ->on($tableNames['permissions']) ->onDelete('cascade'); - $table->primary(['permission_id', $columnNames['model_morph_key'], 'model_type'], - 'model_has_permissions_permission_model_type_primary'); + $table->primary( + ['permission_id', $columnNames['model_morph_key'], 'model_type'], + 'model_has_permissions_permission_model_type_primary' + ); }); Schema::create($tableNames['model_has_roles'], function (Blueprint $table) use ($tableNames, $columnNames) { - $table->unsignedBigInteger('role_id'); + // $table->unsignedBigInteger('role_id'); + $table->uuid('role_id'); $table->string('model_type'); - $table->unsignedBigInteger($columnNames['model_morph_key']); + $table->uuid($columnNames['model_morph_key']); + // $table->unsignedBigInteger($columnNames['model_morph_key']); $table->index([$columnNames['model_morph_key'], 'model_type'], 'model_has_roles_model_id_model_type_index'); $table->foreign('role_id') @@ -66,13 +74,17 @@ class CreatePermissionTables extends Migration ->on($tableNames['roles']) ->onDelete('cascade'); - $table->primary(['role_id', $columnNames['model_morph_key'], 'model_type'], - 'model_has_roles_role_model_type_primary'); + $table->primary( + ['role_id', $columnNames['model_morph_key'], 'model_type'], + 'model_has_roles_role_model_type_primary' + ); }); Schema::create($tableNames['role_has_permissions'], function (Blueprint $table) use ($tableNames) { - $table->unsignedBigInteger('permission_id'); - $table->unsignedBigInteger('role_id'); + // $table->unsignedBigInteger('permission_id'); + // $table->unsignedBigInteger('role_id'); + $table->uuid('permission_id'); + $table->uuid('role_id'); $table->foreign('permission_id') ->references('id') diff --git a/resources/views/layouts/menu.blade.php b/resources/views/layouts/menu.blade.php index 4863404..8847270 100644 --- a/resources/views/layouts/menu.blade.php +++ b/resources/views/layouts/menu.blade.php @@ -32,7 +32,7 @@ <a href="{{ url('dosen') }}"> Dosen Perguruan Tinggi </a> </li> <li> - <a href="{{ url('penlitiasing') }}"> Peneliti Asing </a> + <a href="{{ url('penelitiasing') }}"> Peneliti Asing </a> </li> <li> <a href="{{ url('stafpendukung') }}"> Sumber Daya Staf Pendukung </a>