@@ -4,8 +4,7 @@ |
||
4 | 4 | use Platine\Database\Schema\CreateTable; |
5 | 5 | use Platine\Framework\Migration\AbstractMigration; |
6 | 6 | |
7 | -class AddUsersTable20210705065248 extends AbstractMigration |
|
8 | -{ |
|
7 | +class AddUsersTable20210705065248 extends AbstractMigration { |
|
9 | 8 | |
10 | 9 | public function up(): void |
11 | 10 | { |
@@ -11,7 +11,7 @@ |
||
11 | 11 | public function up(): void |
12 | 12 | { |
13 | 13 | //Action when migrate up |
14 | - $this->create('users', function (CreateTable $table) { |
|
14 | + $this->create('users', function(CreateTable $table) { |
|
15 | 15 | $table->integer('id') |
16 | 16 | ->autoincrement() |
17 | 17 | ->primary(); |
@@ -10,46 +10,46 @@ discard block |
||
10 | 10 | |
11 | 11 | public function up(): void |
12 | 12 | { |
13 | - //Action when migrate up |
|
13 | + //Action when migrate up |
|
14 | 14 | $this->create('users', function (CreateTable $table) { |
15 | 15 | $table->integer('id') |
16 | - ->autoincrement() |
|
17 | - ->primary(); |
|
16 | + ->autoincrement() |
|
17 | + ->primary(); |
|
18 | 18 | |
19 | 19 | $table->string('username') |
20 | - ->description('The user username') |
|
21 | - ->unique() |
|
22 | - ->notNull(); |
|
20 | + ->description('The user username') |
|
21 | + ->unique() |
|
22 | + ->notNull(); |
|
23 | 23 | |
24 | 24 | $table->string('email') |
25 | - ->description('The user email') |
|
26 | - ->unique() |
|
27 | - ->notNull(); |
|
25 | + ->description('The user email') |
|
26 | + ->unique() |
|
27 | + ->notNull(); |
|
28 | 28 | |
29 | 29 | $table->string('password') |
30 | - ->description('The user password') |
|
31 | - ->notNull(); |
|
30 | + ->description('The user password') |
|
31 | + ->notNull(); |
|
32 | 32 | |
33 | 33 | $table->fixed('status', 1) |
34 | - ->description('The user status, A=Active, D=Deactive') |
|
35 | - ->defaultValue('D'); |
|
34 | + ->description('The user status, A=Active, D=Deactive') |
|
35 | + ->defaultValue('D'); |
|
36 | 36 | |
37 | 37 | $table->integer('age') |
38 | - ->size('tiny') |
|
39 | - ->description('The user age'); |
|
38 | + ->size('tiny') |
|
39 | + ->description('The user age'); |
|
40 | 40 | |
41 | 41 | $table->string('lastname') |
42 | - ->description('The user lastname'); |
|
42 | + ->description('The user lastname'); |
|
43 | 43 | |
44 | 44 | $table->string('firstname') |
45 | - ->description('The user firstname'); |
|
45 | + ->description('The user firstname'); |
|
46 | 46 | |
47 | 47 | $table->datetime('created_at') |
48 | - ->description('created date') |
|
49 | - ->notNull(); |
|
48 | + ->description('created date') |
|
49 | + ->notNull(); |
|
50 | 50 | |
51 | 51 | $table->datetime('updated_at') |
52 | - ->description('last updated date'); |
|
52 | + ->description('last updated date'); |
|
53 | 53 | |
54 | 54 | $table->engine('INNODB'); |
55 | 55 | }); |
@@ -57,7 +57,7 @@ discard block |
||
57 | 57 | |
58 | 58 | public function down(): void |
59 | 59 | { |
60 | - //Action when migrate down |
|
60 | + //Action when migrate down |
|
61 | 61 | $this->drop('users'); |
62 | 62 | } |
63 | 63 | } |
@@ -4,8 +4,7 @@ |
||
4 | 4 | use Platine\Database\Schema\CreateTable; |
5 | 5 | use Platine\Framework\Migration\AbstractMigration; |
6 | 6 | |
7 | -class AddPermissionRolesTable20210717094822 extends AbstractMigration |
|
8 | -{ |
|
7 | +class AddPermissionRolesTable20210717094822 extends AbstractMigration { |
|
9 | 8 | |
10 | 9 | public function up(): void |
11 | 10 | { |
@@ -10,7 +10,7 @@ discard block |
||
10 | 10 | |
11 | 11 | public function up(): void |
12 | 12 | { |
13 | - //Action when migrate up |
|
13 | + //Action when migrate up |
|
14 | 14 | $this->create('permissions_roles', function (CreateTable $table) { |
15 | 15 | $table->integer('permission_id'); |
16 | 16 | $table->integer('role_id'); |
@@ -18,12 +18,12 @@ discard block |
||
18 | 18 | $table->primary(['permission_id', 'role_id']); |
19 | 19 | |
20 | 20 | $table->foreign('permission_id') |
21 | - ->references('permissions', 'id') |
|
22 | - ->onDelete('CASCADE'); |
|
21 | + ->references('permissions', 'id') |
|
22 | + ->onDelete('CASCADE'); |
|
23 | 23 | |
24 | 24 | $table->foreign('role_id') |
25 | - ->references('roles', 'id') |
|
26 | - ->onDelete('CASCADE'); |
|
25 | + ->references('roles', 'id') |
|
26 | + ->onDelete('CASCADE'); |
|
27 | 27 | |
28 | 28 | $table->engine('INNODB'); |
29 | 29 | }); |
@@ -31,7 +31,7 @@ discard block |
||
31 | 31 | |
32 | 32 | public function down(): void |
33 | 33 | { |
34 | - //Action when migrate down |
|
34 | + //Action when migrate down |
|
35 | 35 | $this->drop('permissions_roles'); |
36 | 36 | } |
37 | 37 | } |
@@ -11,7 +11,7 @@ |
||
11 | 11 | public function up(): void |
12 | 12 | { |
13 | 13 | //Action when migrate up |
14 | - $this->create('permissions_roles', function (CreateTable $table) { |
|
14 | + $this->create('permissions_roles', function(CreateTable $table) { |
|
15 | 15 | $table->integer('permission_id'); |
16 | 16 | $table->integer('role_id'); |
17 | 17 |
@@ -4,8 +4,7 @@ |
||
4 | 4 | use Platine\Database\Schema\CreateTable; |
5 | 5 | use Platine\Framework\Migration\AbstractMigration; |
6 | 6 | |
7 | -class AddRoleUsersTable20210717100434 extends AbstractMigration |
|
8 | -{ |
|
7 | +class AddRoleUsersTable20210717100434 extends AbstractMigration { |
|
9 | 8 | |
10 | 9 | public function up(): void |
11 | 10 | { |
@@ -10,7 +10,7 @@ discard block |
||
10 | 10 | |
11 | 11 | public function up(): void |
12 | 12 | { |
13 | - //Action when migrate up |
|
13 | + //Action when migrate up |
|
14 | 14 | $this->create('roles_users', function (CreateTable $table) { |
15 | 15 | $table->integer('user_id'); |
16 | 16 | $table->integer('role_id'); |
@@ -31,7 +31,7 @@ discard block |
||
31 | 31 | |
32 | 32 | public function down(): void |
33 | 33 | { |
34 | - //Action when migrate down |
|
34 | + //Action when migrate down |
|
35 | 35 | $this->drop('roles_users'); |
36 | 36 | } |
37 | 37 | } |
@@ -11,7 +11,7 @@ |
||
11 | 11 | public function up(): void |
12 | 12 | { |
13 | 13 | //Action when migrate up |
14 | - $this->create('roles_users', function (CreateTable $table) { |
|
14 | + $this->create('roles_users', function(CreateTable $table) { |
|
15 | 15 | $table->integer('user_id'); |
16 | 16 | $table->integer('role_id'); |
17 | 17 |
@@ -62,8 +62,7 @@ |
||
62 | 62 | * @package Platine\Framework\Auth\Middleware |
63 | 63 | * @template T |
64 | 64 | */ |
65 | -class AuthorizationMiddleware implements MiddlewareInterface |
|
66 | -{ |
|
65 | +class AuthorizationMiddleware implements MiddlewareInterface { |
|
67 | 66 | |
68 | 67 | /** |
69 | 68 | * The Authorization instance |
@@ -62,8 +62,7 @@ |
||
62 | 62 | * @package Platine\Framework\Auth\Middleware |
63 | 63 | * @template T |
64 | 64 | */ |
65 | -class AuthenticationMiddleware implements MiddlewareInterface |
|
66 | -{ |
|
65 | +class AuthenticationMiddleware implements MiddlewareInterface { |
|
67 | 66 | |
68 | 67 | /** |
69 | 68 | * The Authentication instance |
@@ -37,6 +37,5 @@ |
||
37 | 37 | * @class InvalidCredentialsException |
38 | 38 | * @package Platine\Framework\Auth\Exception |
39 | 39 | */ |
40 | -class InvalidCredentialsException extends AuthenticationException |
|
41 | -{ |
|
40 | +class InvalidCredentialsException extends AuthenticationException { |
|
42 | 41 | } |
@@ -37,6 +37,5 @@ |
||
37 | 37 | * @class AccountNotFoundException |
38 | 38 | * @package Platine\Framework\Auth\Exception |
39 | 39 | */ |
40 | -class AccountNotFoundException extends AuthenticationException |
|
41 | -{ |
|
40 | +class AccountNotFoundException extends AuthenticationException { |
|
42 | 41 | } |
@@ -37,6 +37,5 @@ |
||
37 | 37 | * @class MissingCredentialsException |
38 | 38 | * @package Platine\Framework\Auth\Exception |
39 | 39 | */ |
40 | -class MissingCredentialsException extends AuthenticationException |
|
41 | -{ |
|
40 | +class MissingCredentialsException extends AuthenticationException { |
|
42 | 41 | } |
@@ -39,6 +39,5 @@ |
||
39 | 39 | * @class AuthenticationException |
40 | 40 | * @package Platine\Framework\Auth\Exception |
41 | 41 | */ |
42 | -class AuthenticationException extends Exception |
|
43 | -{ |
|
42 | +class AuthenticationException extends Exception { |
|
44 | 43 | } |