@@ -31,17 +31,17 @@ discard block |
||
| 31 | 31 | class RoleAction |
| 32 | 32 | { |
| 33 | 33 | /** |
| 34 | - * Create new instance |
|
| 35 | - * @param Lang $lang |
|
| 36 | - * @param Pagination $pagination |
|
| 37 | - * @param Template $template |
|
| 38 | - * @param Flash $flash |
|
| 39 | - * @param RouteHelper $routeHelper |
|
| 40 | - * @param LoggerInterface $logger |
|
| 41 | - * @param PermissionRepository $permissionRepository |
|
| 42 | - * @param RoleRepository $roleRepository |
|
| 43 | - * @param StatusList $statusList |
|
| 44 | - */ |
|
| 34 | + * Create new instance |
|
| 35 | + * @param Lang $lang |
|
| 36 | + * @param Pagination $pagination |
|
| 37 | + * @param Template $template |
|
| 38 | + * @param Flash $flash |
|
| 39 | + * @param RouteHelper $routeHelper |
|
| 40 | + * @param LoggerInterface $logger |
|
| 41 | + * @param PermissionRepository $permissionRepository |
|
| 42 | + * @param RoleRepository $roleRepository |
|
| 43 | + * @param StatusList $statusList |
|
| 44 | + */ |
|
| 45 | 45 | public function __construct( |
| 46 | 46 | protected Lang $lang, |
| 47 | 47 | protected Pagination $pagination, |
@@ -56,16 +56,16 @@ discard block |
||
| 56 | 56 | } |
| 57 | 57 | |
| 58 | 58 | /** |
| 59 | - * List all entities |
|
| 60 | - * @param ServerRequestInterface $request |
|
| 61 | - * @return ResponseInterface |
|
| 62 | - */ |
|
| 59 | + * List all entities |
|
| 60 | + * @param ServerRequestInterface $request |
|
| 61 | + * @return ResponseInterface |
|
| 62 | + */ |
|
| 63 | 63 | public function index(ServerRequestInterface $request): ResponseInterface |
| 64 | 64 | { |
| 65 | 65 | $context = []; |
| 66 | 66 | $param = new RequestData($request); |
| 67 | 67 | $totalItems = $this->roleRepository->query() |
| 68 | - ->count('id'); |
|
| 68 | + ->count('id'); |
|
| 69 | 69 | |
| 70 | 70 | $currentPage = (int) $param->get('page', 1); |
| 71 | 71 | |
@@ -93,10 +93,10 @@ discard block |
||
| 93 | 93 | } |
| 94 | 94 | |
| 95 | 95 | /** |
| 96 | - * List entity detail |
|
| 97 | - * @param ServerRequestInterface $request |
|
| 98 | - * @return ResponseInterface |
|
| 99 | - */ |
|
| 96 | + * List entity detail |
|
| 97 | + * @param ServerRequestInterface $request |
|
| 98 | + * @return ResponseInterface |
|
| 99 | + */ |
|
| 100 | 100 | public function detail(ServerRequestInterface $request): ResponseInterface |
| 101 | 101 | { |
| 102 | 102 | $context = []; |
@@ -123,10 +123,10 @@ discard block |
||
| 123 | 123 | } |
| 124 | 124 | |
| 125 | 125 | /** |
| 126 | - * Create new entity |
|
| 127 | - * @param ServerRequestInterface $request |
|
| 128 | - * @return ResponseInterface |
|
| 129 | - */ |
|
| 126 | + * Create new entity |
|
| 127 | + * @param ServerRequestInterface $request |
|
| 128 | + * @return ResponseInterface |
|
| 129 | + */ |
|
| 130 | 130 | public function create(ServerRequestInterface $request): ResponseInterface |
| 131 | 131 | { |
| 132 | 132 | $context = []; |
@@ -136,7 +136,7 @@ discard block |
||
| 136 | 136 | $context['param'] = $formParam; |
| 137 | 137 | |
| 138 | 138 | $permissions = $this->permissionRepository->orderBy('code') |
| 139 | - ->all(); |
|
| 139 | + ->all(); |
|
| 140 | 140 | |
| 141 | 141 | $context['permissions'] = $permissions; |
| 142 | 142 | |
@@ -160,8 +160,8 @@ discard block |
||
| 160 | 160 | } |
| 161 | 161 | |
| 162 | 162 | $entityExist = $this->roleRepository->findBy([ |
| 163 | - 'name' => $formParam->getName(), |
|
| 164 | - ]); |
|
| 163 | + 'name' => $formParam->getName(), |
|
| 164 | + ]); |
|
| 165 | 165 | |
| 166 | 166 | if ($entityExist !== null) { |
| 167 | 167 | $this->flash->setError($this->lang->tr('This record already exist')); |
@@ -175,7 +175,7 @@ discard block |
||
| 175 | 175 | |
| 176 | 176 | /** @var Role $role */ |
| 177 | 177 | $role = $this->roleRepository->create([ |
| 178 | - 'name' => $formParam->getName(), |
|
| 178 | + 'name' => $formParam->getName(), |
|
| 179 | 179 | 'description' => $formParam->getDescription(), |
| 180 | 180 | ]); |
| 181 | 181 | |
@@ -207,10 +207,10 @@ discard block |
||
| 207 | 207 | } |
| 208 | 208 | |
| 209 | 209 | /** |
| 210 | - * Update existing entity |
|
| 211 | - * @param ServerRequestInterface $request |
|
| 212 | - * @return ResponseInterface |
|
| 213 | - */ |
|
| 210 | + * Update existing entity |
|
| 211 | + * @param ServerRequestInterface $request |
|
| 212 | + * @return ResponseInterface |
|
| 213 | + */ |
|
| 214 | 214 | public function update(ServerRequestInterface $request): ResponseInterface |
| 215 | 215 | { |
| 216 | 216 | $context = []; |
@@ -235,7 +235,7 @@ discard block |
||
| 235 | 235 | $context['param']->setPermissions($currentPermissionsId); |
| 236 | 236 | |
| 237 | 237 | $permissions = $this->permissionRepository->orderBy('code') |
| 238 | - ->all(); |
|
| 238 | + ->all(); |
|
| 239 | 239 | |
| 240 | 240 | $context['permissions'] = $permissions; |
| 241 | 241 | |
@@ -261,8 +261,8 @@ discard block |
||
| 261 | 261 | } |
| 262 | 262 | |
| 263 | 263 | $entityExist = $this->roleRepository->findBy([ |
| 264 | - 'name' => $formParam->getName(), |
|
| 265 | - ]); |
|
| 264 | + 'name' => $formParam->getName(), |
|
| 265 | + ]); |
|
| 266 | 266 | |
| 267 | 267 | if ($entityExist !== null && $entityExist->id !== $id) { |
| 268 | 268 | $this->flash->setError($this->lang->tr('This record already exist')); |
@@ -315,10 +315,10 @@ discard block |
||
| 315 | 315 | } |
| 316 | 316 | |
| 317 | 317 | /** |
| 318 | - * Delete the entity |
|
| 319 | - * @param ServerRequestInterface $request |
|
| 320 | - * @return ResponseInterface |
|
| 321 | - */ |
|
| 318 | + * Delete the entity |
|
| 319 | + * @param ServerRequestInterface $request |
|
| 320 | + * @return ResponseInterface |
|
| 321 | + */ |
|
| 322 | 322 | public function delete(ServerRequestInterface $request): ResponseInterface |
| 323 | 323 | { |
| 324 | 324 | $id = (int) $request->getAttribute('id'); |
@@ -28,8 +28,7 @@ |
||
| 28 | 28 | * @class RoleAction |
| 29 | 29 | * @package Platine\App\Http\Action\Role |
| 30 | 30 | */ |
| 31 | -class RoleAction |
|
| 32 | -{ |
|
| 31 | +class RoleAction { |
|
| 33 | 32 | /** |
| 34 | 33 | * Create new instance |
| 35 | 34 | * @param Lang $lang |
@@ -15,21 +15,21 @@ discard block |
||
| 15 | 15 | class PermissionParam extends BaseParam |
| 16 | 16 | { |
| 17 | 17 | /** |
| 18 | - * The code field |
|
| 19 | - * @var string |
|
| 20 | - */ |
|
| 18 | + * The code field |
|
| 19 | + * @var string |
|
| 20 | + */ |
|
| 21 | 21 | protected string $code; |
| 22 | 22 | |
| 23 | 23 | /** |
| 24 | - * The description field |
|
| 25 | - * @var string |
|
| 26 | - */ |
|
| 24 | + * The description field |
|
| 25 | + * @var string |
|
| 26 | + */ |
|
| 27 | 27 | protected string $description; |
| 28 | 28 | |
| 29 | 29 | /** |
| 30 | - * @param TEntity $entity |
|
| 31 | - * @return $this |
|
| 32 | - */ |
|
| 30 | + * @param TEntity $entity |
|
| 31 | + * @return $this |
|
| 32 | + */ |
|
| 33 | 33 | public function fromEntity(Entity $entity): self |
| 34 | 34 | { |
| 35 | 35 | $this->code = $entity->code; |
@@ -39,28 +39,28 @@ discard block |
||
| 39 | 39 | } |
| 40 | 40 | |
| 41 | 41 | /** |
| 42 | - * Return the code value |
|
| 43 | - * @return string |
|
| 44 | - */ |
|
| 42 | + * Return the code value |
|
| 43 | + * @return string |
|
| 44 | + */ |
|
| 45 | 45 | public function getCode(): string |
| 46 | 46 | { |
| 47 | 47 | return $this->code; |
| 48 | 48 | } |
| 49 | 49 | |
| 50 | - /** |
|
| 51 | - * Return the description value |
|
| 52 | - * @return string |
|
| 53 | - */ |
|
| 50 | + /** |
|
| 51 | + * Return the description value |
|
| 52 | + * @return string |
|
| 53 | + */ |
|
| 54 | 54 | public function getDescription(): string |
| 55 | 55 | { |
| 56 | 56 | return $this->description; |
| 57 | 57 | } |
| 58 | 58 | |
| 59 | 59 | /** |
| 60 | - * Set the code value |
|
| 61 | - * @param string $code |
|
| 62 | - * @return $this |
|
| 63 | - */ |
|
| 60 | + * Set the code value |
|
| 61 | + * @param string $code |
|
| 62 | + * @return $this |
|
| 63 | + */ |
|
| 64 | 64 | public function setCode(string $code): self |
| 65 | 65 | { |
| 66 | 66 | $this->code = $code; |
@@ -68,11 +68,11 @@ discard block |
||
| 68 | 68 | return $this; |
| 69 | 69 | } |
| 70 | 70 | |
| 71 | - /** |
|
| 72 | - * Set the description value |
|
| 73 | - * @param string $description |
|
| 74 | - * @return $this |
|
| 75 | - */ |
|
| 71 | + /** |
|
| 72 | + * Set the description value |
|
| 73 | + * @param string $description |
|
| 74 | + * @return $this |
|
| 75 | + */ |
|
| 76 | 76 | public function setDescription(string $description): self |
| 77 | 77 | { |
| 78 | 78 | $this->description = $description; |
@@ -11,14 +11,12 @@ |
||
| 11 | 11 | * @class AuthParam |
| 12 | 12 | * @package Platine\App\Param |
| 13 | 13 | */ |
| 14 | -class StatusList |
|
| 15 | -{ |
|
| 14 | +class StatusList { |
|
| 16 | 15 | /** |
| 17 | 16 | * Create new instance |
| 18 | 17 | * @param Lang $lang |
| 19 | 18 | */ |
| 20 | - public function __construct(protected Lang $lang) |
|
| 21 | - { |
|
| 19 | + public function __construct(protected Lang $lang) { |
|
| 22 | 20 | } |
| 23 | 21 | |
| 24 | 22 | /** |
@@ -9,29 +9,29 @@ discard block |
||
| 9 | 9 | {
|
| 10 | 10 | public function up(): void |
| 11 | 11 | {
|
| 12 | - //Action when migrate up |
|
| 12 | + //Action when migrate up |
|
| 13 | 13 | $this->create('permissions', function (CreateTable $table) {
|
| 14 | 14 | $table->integer('id')
|
| 15 | - ->autoincrement() |
|
| 16 | - ->primary(); |
|
| 15 | + ->autoincrement() |
|
| 16 | + ->primary(); |
|
| 17 | 17 | |
| 18 | 18 | $table->string('code')
|
| 19 | - ->description('The permission code')
|
|
| 20 | - ->unique() |
|
| 21 | - ->notNull(); |
|
| 19 | + ->description('The permission code')
|
|
| 20 | + ->unique() |
|
| 21 | + ->notNull(); |
|
| 22 | 22 | |
| 23 | 23 | $table->string('description')
|
| 24 | - ->description('The permission description')
|
|
| 25 | - ->notNull(); |
|
| 24 | + ->description('The permission description')
|
|
| 25 | + ->notNull(); |
|
| 26 | 26 | |
| 27 | 27 | $table->integer('parent_id')
|
| 28 | - ->description('The parent permission');
|
|
| 28 | + ->description('The parent permission');
|
|
| 29 | 29 | |
| 30 | 30 | $table->timestamps(); |
| 31 | 31 | |
| 32 | 32 | $table->foreign('parent_id')
|
| 33 | - ->references('permissions', 'id')
|
|
| 34 | - ->onDelete('CASCADE');
|
|
| 33 | + ->references('permissions', 'id')
|
|
| 34 | + ->onDelete('CASCADE');
|
|
| 35 | 35 | |
| 36 | 36 | $table->engine('INNODB');
|
| 37 | 37 | }); |
@@ -39,7 +39,7 @@ discard block |
||
| 39 | 39 | |
| 40 | 40 | public function down(): void |
| 41 | 41 | {
|
| 42 | - //Action when migrate down |
|
| 42 | + //Action when migrate down |
|
| 43 | 43 | $this->drop('permissions');
|
| 44 | 44 | } |
| 45 | 45 | } |
@@ -11,15 +11,15 @@ discard block |
||
| 11 | 11 | {
|
| 12 | 12 | public function up(): void |
| 13 | 13 | {
|
| 14 | - //Action when migrate up |
|
| 14 | + //Action when migrate up |
|
| 15 | 15 | $this->create('configurations', function (CreateTable $table) {
|
| 16 | 16 | $table->integer('id')
|
| 17 | 17 | ->autoincrement() |
| 18 | 18 | ->primary(); |
| 19 | 19 | |
| 20 | 20 | $table->string('env')
|
| 21 | - ->description('The config environment')
|
|
| 22 | - ->index(); |
|
| 21 | + ->description('The config environment')
|
|
| 22 | + ->index(); |
|
| 23 | 23 | |
| 24 | 24 | $table->string('module')
|
| 25 | 25 | ->description('The module')
|
@@ -27,24 +27,24 @@ discard block |
||
| 27 | 27 | ->notNull(); |
| 28 | 28 | |
| 29 | 29 | $table->string('name')
|
| 30 | - ->description('The config name')
|
|
| 31 | - ->index() |
|
| 32 | - ->notNull(); |
|
| 30 | + ->description('The config name')
|
|
| 31 | + ->index() |
|
| 32 | + ->notNull(); |
|
| 33 | 33 | |
| 34 | 34 | $table->text('value')
|
| 35 | 35 | ->description('The config value');
|
| 36 | 36 | |
| 37 | 37 | $table->string('type')
|
| 38 | - ->description('The config data type')
|
|
| 39 | - ->notNull(); |
|
| 38 | + ->description('The config data type')
|
|
| 39 | + ->notNull(); |
|
| 40 | 40 | |
| 41 | 41 | $table->text('comment')
|
| 42 | - ->description('The config description');
|
|
| 42 | + ->description('The config description');
|
|
| 43 | 43 | |
| 44 | 44 | $table->enum('status', ['Y', 'N'])
|
| 45 | - ->description('The config status')
|
|
| 46 | - ->defaultValue('Y')
|
|
| 47 | - ->notNull(); |
|
| 45 | + ->description('The config status')
|
|
| 46 | + ->defaultValue('Y')
|
|
| 47 | + ->notNull(); |
|
| 48 | 48 | |
| 49 | 49 | $table->timestamps(); |
| 50 | 50 | |
@@ -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('configurations');
|
| 59 | 59 | } |
| 60 | 60 | } |
@@ -12,7 +12,7 @@ |
||
| 12 | 12 | public function up(): void |
| 13 | 13 | {
|
| 14 | 14 | //Action when migrate up |
| 15 | - $this->create('configurations', function (CreateTable $table) {
|
|
| 15 | + $this->create('configurations', function(CreateTable $table) {
|
|
| 16 | 16 | $table->integer('id')
|
| 17 | 17 | ->autoincrement() |
| 18 | 18 | ->primary(); |
@@ -7,12 +7,11 @@ |
||
| 7 | 7 | use Platine\Database\Schema\CreateTable; |
| 8 | 8 | use Platine\Framework\Migration\AbstractMigration; |
| 9 | 9 | |
| 10 | -class AddConfigurationTable20220109074106 extends AbstractMigration |
|
| 11 | -{
|
|
| 10 | +class AddConfigurationTable20220109074106 extends AbstractMigration { |
|
| 12 | 11 | public function up(): void |
| 13 | 12 | {
|
| 14 | 13 | //Action when migrate up |
| 15 | - $this->create('configurations', function (CreateTable $table) {
|
|
| 14 | + $this->create('configurations', function (CreateTable $table) { |
|
| 16 | 15 | $table->integer('id')
|
| 17 | 16 | ->autoincrement() |
| 18 | 17 | ->primary(); |
@@ -9,41 +9,41 @@ discard block |
||
| 9 | 9 | {
|
| 10 | 10 | public function up(): void |
| 11 | 11 | {
|
| 12 | - //Action when migrate up |
|
| 12 | + //Action when migrate up |
|
| 13 | 13 | $this->create('users', function (CreateTable $table) {
|
| 14 | 14 | $table->integer('id')
|
| 15 | - ->autoincrement() |
|
| 16 | - ->primary(); |
|
| 15 | + ->autoincrement() |
|
| 16 | + ->primary(); |
|
| 17 | 17 | |
| 18 | 18 | $table->string('username')
|
| 19 | - ->description('The username')
|
|
| 20 | - ->unique() |
|
| 21 | - ->notNull(); |
|
| 19 | + ->description('The username')
|
|
| 20 | + ->unique() |
|
| 21 | + ->notNull(); |
|
| 22 | 22 | |
| 23 | 23 | $table->string('email')
|
| 24 | - ->description('The user email')
|
|
| 25 | - ->unique() |
|
| 26 | - ->notNull(); |
|
| 24 | + ->description('The user email')
|
|
| 25 | + ->unique() |
|
| 26 | + ->notNull(); |
|
| 27 | 27 | |
| 28 | 28 | $table->string('password')
|
| 29 | - ->description('The user password')
|
|
| 30 | - ->notNull(); |
|
| 29 | + ->description('The user password')
|
|
| 30 | + ->notNull(); |
|
| 31 | 31 | |
| 32 | 32 | $table->enum('status', ['A', 'D'])
|
| 33 | - ->description('The user status, A=Active, D=Deactive/Locked')
|
|
| 34 | - ->defaultValue('D')
|
|
| 35 | - ->notNull(); |
|
| 33 | + ->description('The user status, A=Active, D=Deactive/Locked')
|
|
| 34 | + ->defaultValue('D')
|
|
| 35 | + ->notNull(); |
|
| 36 | 36 | |
| 37 | 37 | $table->string('lastname')
|
| 38 | - ->description('The user lastname')
|
|
| 39 | - ->notNull(); |
|
| 38 | + ->description('The user lastname')
|
|
| 39 | + ->notNull(); |
|
| 40 | 40 | |
| 41 | 41 | $table->string('firstname')
|
| 42 | - ->description('The user firstname')
|
|
| 43 | - ->notNull(); |
|
| 42 | + ->description('The user firstname')
|
|
| 43 | + ->notNull(); |
|
| 44 | 44 | |
| 45 | 45 | $table->string('role')
|
| 46 | - ->description('The user role or job');
|
|
| 46 | + ->description('The user role or job');
|
|
| 47 | 47 | |
| 48 | 48 | $table->timestamps(); |
| 49 | 49 | |
@@ -53,7 +53,7 @@ discard block |
||
| 53 | 53 | |
| 54 | 54 | public function down(): void |
| 55 | 55 | {
|
| 56 | - //Action when migrate down |
|
| 56 | + //Action when migrate down |
|
| 57 | 57 | $this->drop('users');
|
| 58 | 58 | } |
| 59 | 59 | } |
@@ -9,26 +9,26 @@ discard block |
||
| 9 | 9 | {
|
| 10 | 10 | public function up(): void |
| 11 | 11 | {
|
| 12 | - //Action when migrate up |
|
| 12 | + //Action when migrate up |
|
| 13 | 13 | $this->create('tokens', function (CreateTable $table) {
|
| 14 | 14 | $table->integer('id')
|
| 15 | 15 | ->autoincrement() |
| 16 | 16 | ->primary(); |
| 17 | 17 | |
| 18 | 18 | $table->string('token')
|
| 19 | - ->unique() |
|
| 20 | - ->notNull(); |
|
| 19 | + ->unique() |
|
| 20 | + ->notNull(); |
|
| 21 | 21 | |
| 22 | 22 | $table->string('refresh_token')
|
| 23 | - ->unique() |
|
| 24 | - ->notNull(); |
|
| 23 | + ->unique() |
|
| 24 | + ->notNull(); |
|
| 25 | 25 | |
| 26 | 26 | $table->datetime('expire_at')
|
| 27 | - ->notNull(); |
|
| 27 | + ->notNull(); |
|
| 28 | 28 | |
| 29 | 29 | $table->integer('user_id')
|
| 30 | - ->description('The owner of the token')
|
|
| 31 | - ->notNull(); |
|
| 30 | + ->description('The owner of the token')
|
|
| 31 | + ->notNull(); |
|
| 32 | 32 | |
| 33 | 33 | $table->timestamps(); |
| 34 | 34 | |
@@ -42,7 +42,7 @@ discard block |
||
| 42 | 42 | |
| 43 | 43 | public function down(): void |
| 44 | 44 | {
|
| 45 | - //Action when migrate down |
|
| 45 | + //Action when migrate down |
|
| 46 | 46 | $this->drop('tokens');
|
| 47 | 47 | } |
| 48 | 48 | } |
@@ -10,7 +10,7 @@ |
||
| 10 | 10 | public function up(): void |
| 11 | 11 | {
|
| 12 | 12 | //Action when migrate up |
| 13 | - $this->create('tokens', function (CreateTable $table) {
|
|
| 13 | + $this->create('tokens', function(CreateTable $table) {
|
|
| 14 | 14 | $table->integer('id')
|
| 15 | 15 | ->autoincrement() |
| 16 | 16 | ->primary(); |
@@ -5,12 +5,11 @@ |
||
| 5 | 5 | use Platine\Database\Schema\CreateTable; |
| 6 | 6 | use Platine\Framework\Migration\AbstractMigration; |
| 7 | 7 | |
| 8 | -class AddApiTokensTable20210823152146 extends AbstractMigration |
|
| 9 | -{
|
|
| 8 | +class AddApiTokensTable20210823152146 extends AbstractMigration { |
|
| 10 | 9 | public function up(): void |
| 11 | 10 | {
|
| 12 | 11 | //Action when migrate up |
| 13 | - $this->create('tokens', function (CreateTable $table) {
|
|
| 12 | + $this->create('tokens', function (CreateTable $table) { |
|
| 14 | 13 | $table->integer('id')
|
| 15 | 14 | ->autoincrement() |
| 16 | 15 | ->primary(); |
@@ -18,28 +18,28 @@ discard block |
||
| 18 | 18 | 'code' => 'permission_list', |
| 19 | 19 | 'description' => 'View permissions', |
| 20 | 20 | 'created_at' => '2023-12-06 00:21:14', |
| 21 | - 'updated_at' => NULL, |
|
| 21 | + 'updated_at' => null, |
|
| 22 | 22 | ], |
| 23 | 23 | 1 => [ |
| 24 | 24 | 'id' => 2, |
| 25 | 25 | 'code' => 'permission_create', |
| 26 | 26 | 'description' => 'Create permission', |
| 27 | 27 | 'created_at' => '2023-12-06 00:38:47', |
| 28 | - 'updated_at' => NULL, |
|
| 28 | + 'updated_at' => null, |
|
| 29 | 29 | ], |
| 30 | 30 | 2 => [ |
| 31 | 31 | 'id' => 3, |
| 32 | 32 | 'code' => 'permission_detail', |
| 33 | 33 | 'description' => 'View detail permission', |
| 34 | 34 | 'created_at' => '2023-12-06 00:39:33', |
| 35 | - 'updated_at' => NULL, |
|
| 35 | + 'updated_at' => null, |
|
| 36 | 36 | ], |
| 37 | 37 | 3 => [ |
| 38 | 38 | 'id' => 4, |
| 39 | 39 | 'code' => 'permission_update', |
| 40 | 40 | 'description' => 'Edit permission', |
| 41 | 41 | 'created_at' => '2023-12-06 00:39:54', |
| 42 | - 'updated_at' => NULL, |
|
| 42 | + 'updated_at' => null, |
|
| 43 | 43 | ], |
| 44 | 44 | 4 => [ |
| 45 | 45 | 'id' => 5, |
@@ -53,28 +53,28 @@ discard block |
||
| 53 | 53 | 'code' => 'role_list', |
| 54 | 54 | 'description' => 'View roles', |
| 55 | 55 | 'created_at' => '2023-12-06 00:21:14', |
| 56 | - 'updated_at' => NULL, |
|
| 56 | + 'updated_at' => null, |
|
| 57 | 57 | ], |
| 58 | 58 | 6 => [ |
| 59 | 59 | 'id' => 7, |
| 60 | 60 | 'code' => 'role_create', |
| 61 | 61 | 'description' => 'Create role', |
| 62 | 62 | 'created_at' => '2023-12-06 00:38:47', |
| 63 | - 'updated_at' => NULL, |
|
| 63 | + 'updated_at' => null, |
|
| 64 | 64 | ], |
| 65 | 65 | 7 => [ |
| 66 | 66 | 'id' => 8, |
| 67 | 67 | 'code' => 'role_detail', |
| 68 | 68 | 'description' => 'View detail role', |
| 69 | 69 | 'created_at' => '2023-12-06 00:39:33', |
| 70 | - 'updated_at' => NULL, |
|
| 70 | + 'updated_at' => null, |
|
| 71 | 71 | ], |
| 72 | 72 | 8 => [ |
| 73 | 73 | 'id' => 9, |
| 74 | 74 | 'code' => 'role_update', |
| 75 | 75 | 'description' => 'Edit role', |
| 76 | 76 | 'created_at' => '2023-12-06 00:39:54', |
| 77 | - 'updated_at' => NULL, |
|
| 77 | + 'updated_at' => null, |
|
| 78 | 78 | ], |
| 79 | 79 | 9 => [ |
| 80 | 80 | 'id' => 10, |
@@ -88,28 +88,28 @@ discard block |
||
| 88 | 88 | 'code' => 'user_list', |
| 89 | 89 | 'description' => 'View users', |
| 90 | 90 | 'created_at' => '2023-12-06 00:21:14', |
| 91 | - 'updated_at' => NULL, |
|
| 91 | + 'updated_at' => null, |
|
| 92 | 92 | ], |
| 93 | 93 | 11 => [ |
| 94 | 94 | 'id' => 12, |
| 95 | 95 | 'code' => 'user_create', |
| 96 | 96 | 'description' => 'Create user', |
| 97 | 97 | 'created_at' => '2023-12-06 00:38:47', |
| 98 | - 'updated_at' => NULL, |
|
| 98 | + 'updated_at' => null, |
|
| 99 | 99 | ], |
| 100 | 100 | 12 => [ |
| 101 | 101 | 'id' => 13, |
| 102 | 102 | 'code' => 'user_detail', |
| 103 | 103 | 'description' => 'View detail user', |
| 104 | 104 | 'created_at' => '2023-12-06 00:39:33', |
| 105 | - 'updated_at' => NULL, |
|
| 105 | + 'updated_at' => null, |
|
| 106 | 106 | ], |
| 107 | 107 | 13 => [ |
| 108 | 108 | 'id' => 14, |
| 109 | 109 | 'code' => 'user_update', |
| 110 | 110 | 'description' => 'Edit user', |
| 111 | 111 | 'created_at' => '2023-12-06 00:39:54', |
| 112 | - 'updated_at' => NULL, |
|
| 112 | + 'updated_at' => null, |
|
| 113 | 113 | ], |
| 114 | 114 | 14 => [ |
| 115 | 115 | 'id' => 15, |
@@ -123,28 +123,28 @@ discard block |
||
| 123 | 123 | 'code' => 'product_category_list', |
| 124 | 124 | 'description' => 'View product categories', |
| 125 | 125 | 'created_at' => '2023-12-06 00:21:14', |
| 126 | - 'updated_at' => NULL, |
|
| 126 | + 'updated_at' => null, |
|
| 127 | 127 | ], |
| 128 | 128 | 16 => [ |
| 129 | 129 | 'id' => 17, |
| 130 | 130 | 'code' => 'product_category_create', |
| 131 | 131 | 'description' => 'Create product category', |
| 132 | 132 | 'created_at' => '2023-12-06 00:38:47', |
| 133 | - 'updated_at' => NULL, |
|
| 133 | + 'updated_at' => null, |
|
| 134 | 134 | ], |
| 135 | 135 | 17 => [ |
| 136 | 136 | 'id' => 18, |
| 137 | 137 | 'code' => 'product_category_detail', |
| 138 | 138 | 'description' => 'View detail product category', |
| 139 | 139 | 'created_at' => '2023-12-06 00:39:33', |
| 140 | - 'updated_at' => NULL, |
|
| 140 | + 'updated_at' => null, |
|
| 141 | 141 | ], |
| 142 | 142 | 18 => [ |
| 143 | 143 | 'id' => 19, |
| 144 | 144 | 'code' => 'product_category_update', |
| 145 | 145 | 'description' => 'Edit product category', |
| 146 | 146 | 'created_at' => '2023-12-06 00:39:54', |
| 147 | - 'updated_at' => NULL, |
|
| 147 | + 'updated_at' => null, |
|
| 148 | 148 | ], |
| 149 | 149 | 19 => [ |
| 150 | 150 | 'id' => 20, |
@@ -158,28 +158,28 @@ discard block |
||
| 158 | 158 | 'code' => 'product_list', |
| 159 | 159 | 'description' => 'View products', |
| 160 | 160 | 'created_at' => '2023-12-06 00:21:14', |
| 161 | - 'updated_at' => NULL, |
|
| 161 | + 'updated_at' => null, |
|
| 162 | 162 | ], |
| 163 | 163 | 21 => [ |
| 164 | 164 | 'id' => 22, |
| 165 | 165 | 'code' => 'product_create', |
| 166 | 166 | 'description' => 'Create product', |
| 167 | 167 | 'created_at' => '2023-12-06 00:38:47', |
| 168 | - 'updated_at' => NULL, |
|
| 168 | + 'updated_at' => null, |
|
| 169 | 169 | ], |
| 170 | 170 | 22 => [ |
| 171 | 171 | 'id' => 23, |
| 172 | 172 | 'code' => 'product_detail', |
| 173 | 173 | 'description' => 'View detail product', |
| 174 | 174 | 'created_at' => '2023-12-06 00:39:33', |
| 175 | - 'updated_at' => NULL, |
|
| 175 | + 'updated_at' => null, |
|
| 176 | 176 | ], |
| 177 | 177 | 23 => [ |
| 178 | 178 | 'id' => 24, |
| 179 | 179 | 'code' => 'product_update', |
| 180 | 180 | 'description' => 'Edit product', |
| 181 | 181 | 'created_at' => '2023-12-06 00:39:54', |
| 182 | - 'updated_at' => NULL, |
|
| 182 | + 'updated_at' => null, |
|
| 183 | 183 | ], |
| 184 | 184 | 24 => [ |
| 185 | 185 | 'id' => 25, |
@@ -9,18 +9,18 @@ discard block |
||
| 9 | 9 | {
|
| 10 | 10 | public function up(): void |
| 11 | 11 | {
|
| 12 | - //Action when migrate up |
|
| 12 | + //Action when migrate up |
|
| 13 | 13 | $this->create('roles', function (CreateTable $table) {
|
| 14 | 14 | $table->integer('id')
|
| 15 | - ->autoincrement() |
|
| 16 | - ->primary(); |
|
| 15 | + ->autoincrement() |
|
| 16 | + ->primary(); |
|
| 17 | 17 | |
| 18 | 18 | $table->string('name')
|
| 19 | - ->description('The role name')
|
|
| 20 | - ->notNull(); |
|
| 19 | + ->description('The role name')
|
|
| 20 | + ->notNull(); |
|
| 21 | 21 | |
| 22 | 22 | $table->string('description')
|
| 23 | - ->description('The role description');
|
|
| 23 | + ->description('The role description');
|
|
| 24 | 24 | |
| 25 | 25 | $table->timestamps(); |
| 26 | 26 | |
@@ -30,7 +30,7 @@ discard block |
||
| 30 | 30 | |
| 31 | 31 | public function down(): void |
| 32 | 32 | {
|
| 33 | - //Action when migrate down |
|
| 33 | + //Action when migrate down |
|
| 34 | 34 | $this->drop('roles');
|
| 35 | 35 | } |
| 36 | 36 | } |