This repository was archived by the owner on Mar 12, 2024. It is now read-only.
File tree Expand file tree Collapse file tree 4 files changed +40
-1
lines changed
Expand file tree Collapse file tree 4 files changed +40
-1
lines changed Original file line number Diff line number Diff line change 1+ <?php
2+
3+ use Illuminate\Support\Facades\Schema;
4+ use Illuminate\Database\Schema\Blueprint;
5+ use Illuminate\Database\Migrations\Migration;
6+
7+ class UpdateRolesTable extends Migration
8+ {
9+ /**
10+ * Run the migrations.
11+ *
12+ * @return void
13+ */
14+ public function up()
15+ {
16+ Schema::table('roles', function (Blueprint $table) {
17+ $table->text('description');
18+ });
19+ }
20+
21+ /**
22+ * Reverse the migrations.
23+ *
24+ * @return void
25+ */
26+ public function down()
27+ {
28+ Schema::table('roles', function (Blueprint $table) {
29+ $table->dropColumn('description');
30+ });
31+ }
32+ }
Original file line number Diff line number Diff line change 2121 <x-jet-input id =" name" type =" text" class =" mt-1 block w-full" wire:model.defer =" role.name" autocomplete =" name" />
2222 <x-jet-input-error for =" role.name" class =" mt-2" />
2323 </div >
24+ <div class =" col-span-6 sm:col-span-4" >
25+ <x-jet-label for =" description" value =" {{ __ (' Role description' ) } }" />
26+ <x-jet-input id =" description" type =" text" class =" mt-1 block w-full" wire:model.defer =" role.description" autocomplete =" description" />
27+ <x-jet-input-error for =" role.description" class =" mt-2" />
28+ </div >
2429 </x-slot >
2530 <x-slot name =" actions" >
2631 <x-jet-action-message class =" mr-3" on =" saved" >
Original file line number Diff line number Diff line change @@ -10,11 +10,13 @@ class Role extends Component
1010 use HandlesPermissions;
1111
1212 public $ role ;
13+ public $ description ;
1314
1415 protected function rules ()
1516 {
1617 return [
1718 'role.name ' => 'required|string ' ,
19+ 'role.description ' => 'required|string ' ,
1820 ];
1921 }
2022
Original file line number Diff line number Diff line change @@ -29,7 +29,7 @@ public function mount(\App\Models\User $user)
2929 {
3030 $ this ->user = $ user ;
3131 $ this ->forUser ($ this ->user );
32- $ this ->userRoles = $ this ->user ->roles ->pluck ('id ' );
32+ $ this ->userRoles = array_map ( ' strval ' , $ this ->user ->roles ->pluck ('id ' )-> toArray () );
3333 }
3434
3535 public function render ()
You can’t perform that action at this time.
0 commit comments