@@ -7,8 +7,8 @@ |
||
| 7 | 7 | |
| 8 | 8 | $app = new Application(); |
| 9 | 9 | $app->setConfigPath(__DIR__ . '/../config') |
| 10 | - ->setAppPath(dirname(__DIR__)) |
|
| 11 | - ->setVendorPath(dirname(__DIR__) . '/../../vendor'); |
|
| 10 | + ->setAppPath(dirname(__DIR__)) |
|
| 11 | + ->setVendorPath(dirname(__DIR__) . '/../../vendor'); |
|
| 12 | 12 | |
| 13 | 13 | $kernel = $app->make(HttpKernel::class); |
| 14 | 14 | |
@@ -195,9 +195,9 @@ discard block |
||
| 195 | 195 | $this->template, |
| 196 | 196 | 'user/create', |
| 197 | 197 | [ |
| 198 | - 'param' => $formParam, |
|
| 199 | - 'status' => $statusList, |
|
| 200 | - 'roles' => $roles |
|
| 198 | + 'param' => $formParam, |
|
| 199 | + 'status' => $statusList, |
|
| 200 | + 'roles' => $roles |
|
| 201 | 201 | ] |
| 202 | 202 | ); |
| 203 | 203 | } |
@@ -218,7 +218,7 @@ discard block |
||
| 218 | 218 | 'created_at' => date('Y-m-d H:i:s'), |
| 219 | 219 | ]); |
| 220 | 220 | |
| 221 | - //Handle roles |
|
| 221 | + //Handle roles |
|
| 222 | 222 | $rolesId = $param->post('roles', []); |
| 223 | 223 | if (!empty($rolesId)) { |
| 224 | 224 | $selectedRoles = $this->roleRepository->findAll(...$rolesId); |
@@ -235,7 +235,7 @@ discard block |
||
| 235 | 235 | $this->template, |
| 236 | 236 | 'user/create', |
| 237 | 237 | [ |
| 238 | - 'param' => $formParam, |
|
| 238 | + 'param' => $formParam, |
|
| 239 | 239 | 'status' => $statusList, |
| 240 | 240 | 'roles' => $roles |
| 241 | 241 | ] |
@@ -109,10 +109,10 @@ discard block |
||
| 109 | 109 | */ |
| 110 | 110 | protected RouteHelper $routeHelper; |
| 111 | 111 | |
| 112 | - /** |
|
| 113 | - * The password hash to be used |
|
| 114 | - * @var HashInterface |
|
| 115 | - */ |
|
| 112 | + /** |
|
| 113 | + * The password hash to be used |
|
| 114 | + * @var HashInterface |
|
| 115 | + */ |
|
| 116 | 116 | protected HashInterface $hash; |
| 117 | 117 | |
| 118 | 118 | /** |
@@ -217,9 +217,9 @@ discard block |
||
| 217 | 217 | $this->template, |
| 218 | 218 | 'user/edit', |
| 219 | 219 | [ |
| 220 | - 'param' => $formParam, |
|
| 221 | - 'status' => $statusList, |
|
| 222 | - 'roles' => $roles |
|
| 220 | + 'param' => $formParam, |
|
| 221 | + 'status' => $statusList, |
|
| 222 | + 'roles' => $roles |
|
| 223 | 223 | ] |
| 224 | 224 | ); |
| 225 | 225 | } |
@@ -262,9 +262,9 @@ discard block |
||
| 262 | 262 | $this->template, |
| 263 | 263 | 'user/edit', |
| 264 | 264 | [ |
| 265 | - 'param' => $formParam, |
|
| 266 | - 'status' => $statusList, |
|
| 267 | - 'roles' => $roles |
|
| 265 | + 'param' => $formParam, |
|
| 266 | + 'status' => $statusList, |
|
| 267 | + 'roles' => $roles |
|
| 268 | 268 | ] |
| 269 | 269 | ); |
| 270 | 270 | } |
@@ -100,37 +100,37 @@ |
||
| 100 | 100 | public function setRules(): void |
| 101 | 101 | { |
| 102 | 102 | $this->validator->addRules('username', [ |
| 103 | - new NotEmpty(), |
|
| 104 | - new MinLength(3), |
|
| 105 | - new AlphaDash() |
|
| 103 | + new NotEmpty(), |
|
| 104 | + new MinLength(3), |
|
| 105 | + new AlphaDash() |
|
| 106 | 106 | ]); |
| 107 | 107 | |
| 108 | 108 | $this->validator->addRules('lastname', [ |
| 109 | - new NotEmpty(), |
|
| 110 | - new MinLength(3) |
|
| 109 | + new NotEmpty(), |
|
| 110 | + new MinLength(3) |
|
| 111 | 111 | ]); |
| 112 | 112 | |
| 113 | 113 | $this->validator->addRules('firstname', [ |
| 114 | - new NotEmpty(), |
|
| 115 | - new MinLength(3) |
|
| 114 | + new NotEmpty(), |
|
| 115 | + new MinLength(3) |
|
| 116 | 116 | ]); |
| 117 | 117 | |
| 118 | 118 | $this->validator->addRules('status', [ |
| 119 | - new NotEmpty(), |
|
| 120 | - new InList([0, 1]) |
|
| 119 | + new NotEmpty(), |
|
| 120 | + new InList([0, 1]) |
|
| 121 | 121 | ]); |
| 122 | 122 | |
| 123 | 123 | $this->validator->addRules('email', [ |
| 124 | - new NotEmpty(), |
|
| 125 | - new Email() |
|
| 124 | + new NotEmpty(), |
|
| 125 | + new Email() |
|
| 126 | 126 | ]); |
| 127 | 127 | |
| 128 | 128 | $this->validator->addRules('role', [ |
| 129 | - new MinLength(3) |
|
| 129 | + new MinLength(3) |
|
| 130 | 130 | ]); |
| 131 | 131 | |
| 132 | 132 | $this->validator->addRules('password', [ |
| 133 | - new MinLength(5), |
|
| 133 | + new MinLength(5), |
|
| 134 | 134 | ]); |
| 135 | 135 | } |
| 136 | 136 | } |
@@ -82,7 +82,7 @@ discard block |
||
| 82 | 82 | ) { |
| 83 | 83 | parent::__construct($app, $repository, $config, $filesystem); |
| 84 | 84 | $this->setName('migration:init') |
| 85 | - ->setDescription('Initialize the migration by creating migration table'); |
|
| 85 | + ->setDescription('Initialize the migration by creating migration table'); |
|
| 86 | 86 | |
| 87 | 87 | $this->schema = $schema; |
| 88 | 88 | } |
@@ -120,10 +120,10 @@ discard block |
||
| 120 | 120 | $tableName = $this->table; |
| 121 | 121 | $this->schema->create($tableName, function (CreateTable $table) { |
| 122 | 122 | $table->string('version', 20) |
| 123 | - ->description('The migration version') |
|
| 124 | - ->primary(); |
|
| 123 | + ->description('The migration version') |
|
| 124 | + ->primary(); |
|
| 125 | 125 | $table->string('description') |
| 126 | - ->description('The migration description'); |
|
| 126 | + ->description('The migration description'); |
|
| 127 | 127 | $table->datetime('created_at') |
| 128 | 128 | ->description('Migration run time'); |
| 129 | 129 | |
@@ -318,7 +318,7 @@ |
||
| 318 | 318 | // if ($lastModule) { |
| 319 | 319 | $last[$lastModule][$module] = $this->loader->load($this->env, $module); |
| 320 | 320 | //} else { |
| 321 | - // $last[$root][$module] = $this->loader->load($this->env, $module); |
|
| 321 | + // $last[$root][$module] = $this->loader->load($this->env, $module); |
|
| 322 | 322 | //} |
| 323 | 323 | //$last = array_merge_recursive($last, $last[$lastModule][$module]); |
| 324 | 324 | |
@@ -10,18 +10,18 @@ |
||
| 10 | 10 | |
| 11 | 11 | public function up(): void |
| 12 | 12 | { |
| 13 | - //Action when migrate up |
|
| 13 | + //Action when migrate up |
|
| 14 | 14 | $this->alter('users', function (AlterTable $table) { |
| 15 | 15 | $table->string('role') |
| 16 | - ->description('The user role or function'); |
|
| 16 | + ->description('The user role or function'); |
|
| 17 | 17 | }); |
| 18 | 18 | } |
| 19 | 19 | |
| 20 | 20 | public function down(): void |
| 21 | 21 | { |
| 22 | - //Action when migrate down |
|
| 22 | + //Action when migrate down |
|
| 23 | 23 | $this->alter('users', function (AlterTable $table) { |
| 24 | - $table->dropColumn('role'); |
|
| 24 | + $table->dropColumn('role'); |
|
| 25 | 25 | }); |
| 26 | 26 | } |
| 27 | 27 | } |
@@ -10,39 +10,39 @@ 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('config', function (CreateTable $table) { |
| 15 | 15 | $table->integer('id') |
| 16 | - ->autoincrement() |
|
| 17 | - ->primary(); |
|
| 16 | + ->autoincrement() |
|
| 17 | + ->primary(); |
|
| 18 | 18 | $table->integer('parent_id') |
| 19 | - ->description('The parent config'); |
|
| 19 | + ->description('The parent config'); |
|
| 20 | 20 | $table->string('env') |
| 21 | - ->description('The config environment') |
|
| 22 | - ->index(); |
|
| 21 | + ->description('The config environment') |
|
| 22 | + ->index(); |
|
| 23 | 23 | $table->string('module') |
| 24 | - ->description('The module') |
|
| 25 | - ->index() |
|
| 26 | - ->notNull(); |
|
| 24 | + ->description('The module') |
|
| 25 | + ->index() |
|
| 26 | + ->notNull(); |
|
| 27 | 27 | $table->string('name') |
| 28 | - ->description('The config name') |
|
| 29 | - ->index(); |
|
| 28 | + ->description('The config name') |
|
| 29 | + ->index(); |
|
| 30 | 30 | $table->string('value') |
| 31 | - ->description('The config value'); |
|
| 31 | + ->description('The config value'); |
|
| 32 | 32 | $table->string('type') |
| 33 | - ->description('The config data type'); |
|
| 33 | + ->description('The config data type'); |
|
| 34 | 34 | $table->text('comment') |
| 35 | - ->description('The config description'); |
|
| 35 | + ->description('The config description'); |
|
| 36 | 36 | $table->integer('status') |
| 37 | - ->size('tiny') |
|
| 38 | - ->description('The config status') |
|
| 39 | - ->defaultValue(0) |
|
| 40 | - ->notNull(); |
|
| 37 | + ->size('tiny') |
|
| 38 | + ->description('The config status') |
|
| 39 | + ->defaultValue(0) |
|
| 40 | + ->notNull(); |
|
| 41 | 41 | $table->datetime('created_at') |
| 42 | - ->description('created date') |
|
| 43 | - ->notNull(); |
|
| 42 | + ->description('created date') |
|
| 43 | + ->notNull(); |
|
| 44 | 44 | $table->datetime('updated_at') |
| 45 | - ->description('updated date'); |
|
| 45 | + ->description('updated date'); |
|
| 46 | 46 | |
| 47 | 47 | $table->foreign('parent_id') |
| 48 | 48 | ->references('config', 'id') |
@@ -54,7 +54,7 @@ discard block |
||
| 54 | 54 | |
| 55 | 55 | public function down(): void |
| 56 | 56 | { |
| 57 | - //Action when migrate down |
|
| 57 | + //Action when migrate down |
|
| 58 | 58 | $this->drop('config'); |
| 59 | 59 | } |
| 60 | 60 | } |
@@ -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 | } |