@@ -13,7 +13,7 @@ |
||
13 | 13 | */ |
14 | 14 | public function up() |
15 | 15 | { |
16 | - Schema::create('role_user', function (Blueprint $table) { |
|
16 | + Schema::create('role_user', function(Blueprint $table) { |
|
17 | 17 | $pkMethod = config('rakshak.users.pk_type', 'uuid'); |
18 | 18 | // dd('pkMethod: ' . $pkMethod); |
19 | 19 |
@@ -13,7 +13,7 @@ discard block |
||
13 | 13 | */ |
14 | 14 | public function up() |
15 | 15 | { |
16 | - Schema::table('users', function (Blueprint $table) { |
|
16 | + Schema::table('users', function(Blueprint $table) { |
|
17 | 17 | $table->string('username')->nullable(); |
18 | 18 | $table->string('mobile')->nullable(); |
19 | 19 | $table->timestamp('mobile_verified_at')->nullable(); |
@@ -32,28 +32,28 @@ discard block |
||
32 | 32 | */ |
33 | 33 | public function down() |
34 | 34 | { |
35 | - Schema::table('users', function (Blueprint $table) { |
|
35 | + Schema::table('users', function(Blueprint $table) { |
|
36 | 36 | $table->dropColumn('username'); |
37 | 37 | }); |
38 | - Schema::table('users', function (Blueprint $table) { |
|
38 | + Schema::table('users', function(Blueprint $table) { |
|
39 | 39 | $table->dropColumn('mobile'); |
40 | 40 | }); |
41 | - Schema::table('users', function (Blueprint $table) { |
|
41 | + Schema::table('users', function(Blueprint $table) { |
|
42 | 42 | $table->dropColumn('mobile_verified_at'); |
43 | 43 | }); |
44 | - Schema::table('users', function (Blueprint $table) { |
|
44 | + Schema::table('users', function(Blueprint $table) { |
|
45 | 45 | $table->dropColumn('enable_2fa'); |
46 | 46 | }); |
47 | - Schema::table('users', function (Blueprint $table) { |
|
47 | + Schema::table('users', function(Blueprint $table) { |
|
48 | 48 | $table->dropColumn('otp_token'); |
49 | 49 | }); |
50 | - Schema::table('users', function (Blueprint $table) { |
|
50 | + Schema::table('users', function(Blueprint $table) { |
|
51 | 51 | $table->dropColumn('otp_expiry'); |
52 | 52 | }); |
53 | - Schema::table('users', function (Blueprint $table) { |
|
53 | + Schema::table('users', function(Blueprint $table) { |
|
54 | 54 | $table->dropColumn('otp_channel'); |
55 | 55 | }); |
56 | - Schema::table('users', function (Blueprint $table) { |
|
56 | + Schema::table('users', function(Blueprint $table) { |
|
57 | 57 | $table->dropColumn('status'); |
58 | 58 | }); |
59 | 59 | } |
@@ -19,14 +19,14 @@ |
||
19 | 19 | $table->timestamps(); |
20 | 20 | |
21 | 21 | $table->foreign('ability_id') |
22 | - ->references('id') |
|
23 | - ->on('abilities') |
|
24 | - ->onDelete('cascade'); |
|
22 | + ->references('id') |
|
23 | + ->on('abilities') |
|
24 | + ->onDelete('cascade'); |
|
25 | 25 | |
26 | 26 | $table->foreign('role_id') |
27 | - ->references('id') |
|
28 | - ->on('roles') |
|
29 | - ->onDelete('cascade'); |
|
27 | + ->references('id') |
|
28 | + ->on('roles') |
|
29 | + ->onDelete('cascade'); |
|
30 | 30 | |
31 | 31 | $table->primary(['ability_id', 'role_id']); |
32 | 32 | }); |
@@ -13,7 +13,7 @@ |
||
13 | 13 | */ |
14 | 14 | public function up() |
15 | 15 | { |
16 | - Schema::create('ability_role', function (Blueprint $table) { |
|
16 | + Schema::create('ability_role', function(Blueprint $table) { |
|
17 | 17 | $table->uuid('ability_id'); |
18 | 18 | $table->uuid('role_id'); |
19 | 19 | $table->timestamps(); |
@@ -13,7 +13,7 @@ |
||
13 | 13 | */ |
14 | 14 | public function up() |
15 | 15 | { |
16 | - Schema::create('abilities', function (Blueprint $table) { |
|
16 | + Schema::create('abilities', function(Blueprint $table) { |
|
17 | 17 | $table->uuid('id'); |
18 | 18 | $table->string('name')->unique(); |
19 | 19 | $table->string('label'); |
@@ -14,7 +14,7 @@ |
||
14 | 14 | */ |
15 | 15 | public function up() |
16 | 16 | { |
17 | - Schema::create('rakshak_settings', function (Blueprint $table) { |
|
17 | + Schema::create('rakshak_settings', function(Blueprint $table) { |
|
18 | 18 | $table->uuid('id'); |
19 | 19 | $table->boolean('enable_2fa')->default(false); |
20 | 20 | $table->string('channel_2fa')->default('email'); |
@@ -14,7 +14,7 @@ |
||
14 | 14 | */ |
15 | 15 | public function up() |
16 | 16 | { |
17 | - Schema::create('roles', function (Blueprint $table) { |
|
17 | + Schema::create('roles', function(Blueprint $table) { |
|
18 | 18 | $table->uuid('id'); |
19 | 19 | $table->string('name')->unique(); |
20 | 20 | $table->string('label'); |
@@ -2,7 +2,7 @@ |
||
2 | 2 | |
3 | 3 | use Faker\Generator as Faker; |
4 | 4 | |
5 | -$factory->define(Thinkstudeo\Rakshak\Ability::class, function (Faker $faker) { |
|
5 | +$factory->define(Thinkstudeo\Rakshak\Ability::class, function(Faker $faker) { |
|
6 | 6 | return [ |
7 | 7 | 'name' => $faker->word(), |
8 | 8 | 'label' => ucfirst($faker->word()), |
@@ -3,7 +3,7 @@ discard block |
||
3 | 3 | use Faker\Generator as Faker; |
4 | 4 | use Thinkstudeo\Rakshak\Ability; |
5 | 5 | |
6 | -$factory->define(\Thinkstudeo\Rakshak\Role::class, function (Faker $faker) { |
|
6 | +$factory->define(\Thinkstudeo\Rakshak\Role::class, function(Faker $faker) { |
|
7 | 7 | return [ |
8 | 8 | 'name' => $faker->name, |
9 | 9 | 'label' => ucfirst($faker->word), |
@@ -13,7 +13,7 @@ discard block |
||
13 | 13 | }); |
14 | 14 | |
15 | 15 | $factory->state(\Thinkstudeo\Rakshak\Role::class, 'withAbilities', []) |
16 | - ->afterCreatingState(\Thinkstudeo\Rakshak\Role::class, 'withAbilities', function ($role, $faker) { |
|
16 | + ->afterCreatingState(\Thinkstudeo\Rakshak\Role::class, 'withAbilities', function($role, $faker) { |
|
17 | 17 | $ability1 = create(Ability::class); |
18 | 18 | $ability2 = create(Ability::class); |
19 | 19 |
@@ -2,7 +2,7 @@ discard block |
||
2 | 2 | |
3 | 3 | use Faker\Generator as Faker; |
4 | 4 | |
5 | -$factory->define(config('auth.providers.users.model'), function (Faker $faker) { |
|
5 | +$factory->define(config('auth.providers.users.model'), function(Faker $faker) { |
|
6 | 6 | $name = $faker->name; |
7 | 7 | |
8 | 8 | return [ |
@@ -17,7 +17,7 @@ discard block |
||
17 | 17 | }); |
18 | 18 | |
19 | 19 | $factory->state(config('auth.providers.users.model'), 'HrManager', ['name' => 'H R Manager']) |
20 | - ->afterCreatingState(config('auth.providers.users.model'), 'HrManager', function ($user, $faker) { |
|
20 | + ->afterCreatingState(config('auth.providers.users.model'), 'HrManager', function($user, $faker) { |
|
21 | 21 | $manageUsers = create(\Thinkstudeo\Rakshak\Ability::class, ['name' => 'manage_users']); |
22 | 22 | |
23 | 23 | $hrManager = create(\Thinkstudeo\Rakshak\Role::class, ['name' => 'hr_manager'])->addAbility($manageUsers); |
@@ -26,7 +26,7 @@ discard block |
||
26 | 26 | }); |
27 | 27 | |
28 | 28 | $factory->state(config('auth.providers.users.model'), 'ContentManager', ['name' => 'Content Manager']) |
29 | - ->afterCreatingState(config('auth.providers.users.model'), 'ContentManager', function ($user, $faker) { |
|
29 | + ->afterCreatingState(config('auth.providers.users.model'), 'ContentManager', function($user, $faker) { |
|
30 | 30 | $manageContent = create(\Thinkstudeo\Rakshak\Ability::class, ['name' => 'manage_content']); |
31 | 31 | |
32 | 32 | $hrManager = create(\Thinkstudeo\Rakshak\Role::class, ['name' => 'content_manager'])->addAbility($manageContent); |