From 1203e770d4ff3a74135cff9b9c8b1b87e8f8430e Mon Sep 17 00:00:00 2001 From: my4fdal Date: Mon, 31 May 2021 08:29:38 +0700 Subject: [PATCH 1/3] remove seeder dumy command --- src/Commands/BadasoContentDummySeeder.php | 45 ----------- .../BadasoContentModuleServiceProvider.php | 2 - src/Seeder/ContentTableSeeder.php | 77 ------------------- 3 files changed, 124 deletions(-) delete mode 100644 src/Commands/BadasoContentDummySeeder.php delete mode 100644 src/Seeder/ContentTableSeeder.php diff --git a/src/Commands/BadasoContentDummySeeder.php b/src/Commands/BadasoContentDummySeeder.php deleted file mode 100644 index eadef0e..0000000 --- a/src/Commands/BadasoContentDummySeeder.php +++ /dev/null @@ -1,45 +0,0 @@ -call('db:seed', [ - '--class' => ContentTableSeeder::class, - ]); - } -} diff --git a/src/Providers/BadasoContentModuleServiceProvider.php b/src/Providers/BadasoContentModuleServiceProvider.php index 4d5d3ba..0ecb04f 100644 --- a/src/Providers/BadasoContentModuleServiceProvider.php +++ b/src/Providers/BadasoContentModuleServiceProvider.php @@ -5,7 +5,6 @@ use Illuminate\Foundation\AliasLoader; use Illuminate\Support\ServiceProvider; use Uasoft\Badaso\Module\Content\BadasoContentModule; -use Uasoft\Badaso\Module\Content\Commands\BadasoContentDummySeeder; use Uasoft\Badaso\Module\Content\Commands\BadasoContentSetup; use Uasoft\Badaso\Module\Content\Facades\BadasoContentModule as FacadesBadasoContentModule; @@ -51,6 +50,5 @@ public function register() private function registerConsoleCommands() { $this->commands(BadasoContentSetup::class); - $this->commands(BadasoContentDummySeeder::class); } } diff --git a/src/Seeder/ContentTableSeeder.php b/src/Seeder/ContentTableSeeder.php deleted file mode 100644 index 2065212..0000000 --- a/src/Seeder/ContentTableSeeder.php +++ /dev/null @@ -1,77 +0,0 @@ -delete(); - - \DB::table('content')->insert([ - 0 => [ - 'id' => 3, - 'slug' => 'home', - 'label' => 'Home', - 'value' => '{"background":{"name":"background","label":"Background","type":"image","data":{}},"title":{"name":"title","label":"Title","type":"text","data":""},"description":{"name":"description","label":"Description","type":"text","data":""}}', - 'created_at' => '2021-05-25 01:50:52', - 'updated_at' => '2021-05-25 01:50:52', - ], - 1 => [ - 'id' => 4, - 'slug' => 'feature', - 'label' => 'Feature', - 'value' => '{"name":{"name":"name","label":"Name","type":"text","data":""},"price":{"name":"price","label":"Price","type":"text","data":""}}', - 'created_at' => '2021-05-25 01:51:45', - 'updated_at' => '2021-05-25 01:51:45', - ], - 2 => [ - 'id' => 5, - 'slug' => 'sponsor', - 'label' => 'Sponsor', - 'value' => '{"badaso_sponsor":{"name":"badaso_sponsor","label":"Badaso Sponsor","type":"image","data":{}},"facebook_sponsor":{"name":"facebook_sponsor","label":"Facebook Sponsor","type":"image","data":{}},"google_sponsor":{"name":"google_sponsor","label":"Google Sponsor","type":"image","data":{}},"windows_sponsor":{"name":"windows_sponsor","label":"Windows Sponsor","type":"image","data":{}}}', - 'created_at' => '2021-05-25 01:55:52', - 'updated_at' => '2021-05-25 01:55:52', - ], - 3 => [ - 'id' => 6, - 'slug' => 'about', - 'label' => 'About', - 'value' => '{"address":{"name":"address","label":"Address","type":"text","data":""},"company_name":{"name":"company_name","label":"Company Name","type":"text","data":""},"privasi_and_cookies":{"name":"privasi_and_cookies","label":"Privasi And Cookies","type":"url","data":{"url":"","text":""}}}', - 'created_at' => '2021-05-25 01:59:21', - 'updated_at' => '2021-05-25 01:59:21', - ], - 4 => [ - 'id' => 7, - 'slug' => 'sosial-media', - 'label' => 'Sosial Media', - 'value' => '{"whatsapp":{"name":"whatsapp","label":"Whatsapp","type":"image","data":{}},"facebook":{"name":"facebook","label":"Facebook","type":"image","data":{}},"instagram":{"name":"instagram","label":"Instagram","type":"image","data":{}},"twitter":{"name":"twitter","label":"Twitter","type":"image","data":{}}}', - 'created_at' => '2021-05-25 02:00:38', - 'updated_at' => '2021-05-25 02:00:38', - ], - 5 => [ - 'id' => 8, - 'slug' => 'carousel', - 'label' => 'Carousel', - 'value' => '{"image_1":{"name":"image_1","label":"Image 1","type":"image","data":{}},"image_2":{"name":"image_2","label":"Image 2","type":"image","data":{}},"image_3":{"name":"image_3","label":"Image 3","type":"image","data":{}},"image_4":{"name":"image_4","label":"Image 4","type":"image","data":{}}}', - 'created_at' => '2021-05-25 02:01:49', - 'updated_at' => '2021-05-25 02:01:49', - ], - ]); - - \DB::commit(); - } catch (Exception $e) { - \DB::rollBack(); - } - } -} From ea6b7cda3c7b547eac86f8d67ead02c9b3cf16cd Mon Sep 17 00:00:00 2001 From: Afdal Date: Mon, 31 May 2021 01:31:07 +0000 Subject: [PATCH 2/3] Apply fixes from StyleCI --- src/Seeder/ContentRolePermissionsSeeder.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Seeder/ContentRolePermissionsSeeder.php b/src/Seeder/ContentRolePermissionsSeeder.php index 2f5919c..8152b05 100644 --- a/src/Seeder/ContentRolePermissionsSeeder.php +++ b/src/Seeder/ContentRolePermissionsSeeder.php @@ -23,7 +23,7 @@ public function run() $permissions = Permission::all(); - if (!is_null($administrator)) { + if (! is_null($administrator)) { foreach ($permissions as $row) { $role_permission = RolePermission::where('role_id', $administrator->id) ->where('permission_id', $row->id) From 2792a69d064fd82b284feed23c9feb640aefcd14 Mon Sep 17 00:00:00 2001 From: Afdal <55905844+my4fdal@users.noreply.github.com> Date: Mon, 31 May 2021 08:34:44 +0700 Subject: [PATCH 3/3] Update CONTRIBUTING.md --- CONTRIBUTING.md | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 4d6a676..1c7289e 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -101,8 +101,11 @@ php artisan badaso-content:setup --force ``` composer dump-autoload ``` - -8. Open the ```env``` file then add the following lines. +9. Run command +``` +php artisan db:seed --class=ContentModuleSeeder +``` +11. Open the ```env``` file then add the following lines. ``` MIX_DEFAULT_MENU=admin MIX_BADASO_MENU=${MIX_DEFAULT_MENU},badaso-content-module @@ -128,4 +131,4 @@ Before submitting an issue you need to make sure: - Refer to [the official Badaso Content Module documentation](https://github.com/uasoft-indonesia/badaso-content-module). - Ask a question on [github discussion](https://github.com/uasoft-indonesia/badaso-content-module/discussions). - Your issue title is concise, on-topic and polite. -- You can and do provide steps to reproduce your issue. \ No newline at end of file +- You can and do provide steps to reproduce your issue.