Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

set seeder #5

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@
"type": "library",
"require": {
"badaso/core": "^2.9",
"badaso/content-module": "^2.1.1",
"badaso/commerce-module": "dev-main"
"badaso/content-module": "^2.1",
"badaso/commerce-module": "^0.3.7"

},
"authors": [
Expand Down
2 changes: 1 addition & 1 deletion src/Commands/ComfreeThemeSetup.php
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ protected function updatePackageJson()
$decoded_json['dependencies']['daisyui'] = '^4.6.0';
$decoded_json['dependencies']['alpinejs'] = '^3.13.5';
$decoded_json['dependencies']['tailwindcss'] = '^3.4.1';
$decoded_json['dependencies']['@tailwindcss/aspect-ratio'] = '^0.4.2';
$decoded_json['dependencies']['alpinejs-money'] = '^1.1.3';
$encoded_json = json_encode($decoded_json, JSON_PRETTY_PRINT);
file_put_contents(base_path('package.json'), $encoded_json);

Expand Down
1 change: 1 addition & 0 deletions src/Controllers/DetailController.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,5 @@ public function index()
{
return view('comfree-theme::pages.detail-page');
}

}
2 changes: 1 addition & 1 deletion src/Seeder/ComfreeThemeContentsSeeder.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ public function run()
0 => [
'slug' => 'comfree-theme',
'label' => 'Comfree Theme',
'value' => '{"navbar":{"name":"navbar","label":"Navbar","type":"array","data":[{"label":{"name":"label","label":"Label","type":"url","data":{"url":"#","text":"Katalog"}}},{"label":{"name":"label","label":"Label","type":"url","data":{"url":"#","text":"Blog"}}}]},"footer":{"name":"footer","label":"Footer","type":"group","data":{"footer1":{"name":"footer1","label":"Footer 1","type":"group","data":{"title":{"name":"title","label":"Title","type":"text","data":"COMFREE THEME"},"description":{"name":"description","label":"Description","type":"text","data":"Comfree Theme merupakan tema toko online yang dibuat khusus untuk Commerce Module"},"socialmedia":{"name":"socialmedia","label":"Social Media","type":"array","data":[{"name":{"name":"name","label":"Name","type":"url","data":{"url":null,"text":null}}}]}}},"footer2":{"name":"footer2","label":"Footer 2","type":"group","data":{"title":{"name":"title","label":"Title","type":"text","data":"LINK PENTING"},"list":{"name":"list","label":"List","type":"array","data":[{"name":{"name":"name","label":"Name","type":"url","data":{"url":null,"text":"Konfirmasi Pembayaran"}}},{"name":{"name":"name","label":"Name","type":"url","data":{"url":null,"text":"Pembayaran & Pengiriman"}}},{"name":{"name":"name","label":"Name","type":"url","data":{"url":null,"text":"Syarat & Ketentuan"}}}]}}},"footer3":{"name":"footer3","label":"Footer 3","type":"group","data":{"title":{"name":"title","label":"Title","type":"text","data":"Market Place"},"application":{"name":"application","label":"Application","type":"array","data":[{"name":{"name":"name","label":"name","type":"url","data":{"url":"https:\\/\\/www.tokopedia.com","text":null}},"icon":{"name":"icon","label":"icon","type":"image","data":"https:\\/\\/demo.saudagarwp.com\\/wp-content\\/themes\\/saudagarwp\\/assets\\/img\\/marketplace-tokopedia.webp"}},{"name":{"name":"name","label":"name","type":"url","data":{"url":"https:\\/\\/www.lazada.co.id","text":null}},"icon":{"name":"icon","label":"icon","type":"image","data":"https:\\/\\/demo.saudagarwp.com\\/wp-content\\/themes\\/saudagarwp\\/assets\\/img\\/marketplace-lazada.webp"}},{"name":{"name":"name","label":"name","type":"url","data":{"url":"https:\\/\\/shopee.co.id","text":null}},"icon":{"name":"icon","label":"icon","type":"image","data":"https:\\/\\/demo.saudagarwp.com\\/wp-content\\/themes\\/saudagarwp\\/assets\\/img\\/marketplace-shopee.webp"}},{"name":{"name":"name","label":"name","type":"url","data":{"url":"https:\\/\\/www.tiktok.com","text":null}},"icon":{"name":"icon","label":"icon","type":"image","data":"https:\\/\\/demo.saudagarwp.com\\/wp-content\\/themes\\/saudagarwp\\/assets\\/img\\/marketplace-tiktok.webp"}}]}}},"copyright":{"name":"copyright","label":"Copyright","type":"text","data":"@Copyright Uasoft 2024. All Rights Reserved"}}}}',
'value' => '{"navbar":{"name":"navbar","label":"Navbar","type":"array","data":[{"label":{"name":"label","label":"Label","type":"url","data":{"url":"/katalog","text":"Katalog"}}},{"label":{"name":"label","label":"Label","type":"url","data":{"url":"/blog","text":"Blog"}}}]},"footer":{"name":"footer","label":"Footer","type":"group","data":{"footer1":{"name":"footer1","label":"Footer 1","type":"group","data":{"title":{"name":"title","label":"Title","type":"text","data":"COMFREE THEME"},"description":{"name":"description","label":"Description","type":"text","data":"Comfree Theme merupakan tema toko online yang dibuat khusus untuk Commerce Module"},"socialmedia":{"name":"socialmedia","label":"Social Media","type":"array","data":[{"name":{"name":"name","label":"Name","type":"url","data":{"url":null,"text":null}}}]}}},"footer2":{"name":"footer2","label":"Footer 2","type":"group","data":{"title":{"name":"title","label":"Title","type":"text","data":"LINK PENTING"},"list":{"name":"list","label":"List","type":"array","data":[{"name":{"name":"name","label":"Name","type":"url","data":{"url":null,"text":"Konfirmasi Pembayaran"}}},{"name":{"name":"name","label":"Name","type":"url","data":{"url":null,"text":"Pembayaran & Pengiriman"}}},{"name":{"name":"name","label":"Name","type":"url","data":{"url":null,"text":"Syarat & Ketentuan"}}}]}}},"footer3":{"name":"footer3","label":"Footer 3","type":"group","data":{"title":{"name":"title","label":"Title","type":"text","data":"Market Place"},"application":{"name":"application","label":"Application","type":"array","data":[{"name":{"name":"name","label":"name","type":"url","data":{"url":"https:\\/\\/www.tokopedia.com","text":null}},"icon":{"name":"icon","label":"icon","type":"image","data":"https:\\/\\/demo.saudagarwp.com\\/wp-content\\/themes\\/saudagarwp\\/assets\\/img\\/marketplace-tokopedia.webp"}},{"name":{"name":"name","label":"name","type":"url","data":{"url":"https:\\/\\/www.lazada.co.id","text":null}},"icon":{"name":"icon","label":"icon","type":"image","data":"https:\\/\\/demo.saudagarwp.com\\/wp-content\\/themes\\/saudagarwp\\/assets\\/img\\/marketplace-lazada.webp"}},{"name":{"name":"name","label":"name","type":"url","data":{"url":"https:\\/\\/shopee.co.id","text":null}},"icon":{"name":"icon","label":"icon","type":"image","data":"https:\\/\\/demo.saudagarwp.com\\/wp-content\\/themes\\/saudagarwp\\/assets\\/img\\/marketplace-shopee.webp"}},{"name":{"name":"name","label":"name","type":"url","data":{"url":"https:\\/\\/www.tiktok.com","text":null}},"icon":{"name":"icon","label":"icon","type":"image","data":"https:\\/\\/demo.saudagarwp.com\\/wp-content\\/themes\\/saudagarwp\\/assets\\/img\\/marketplace-tiktok.webp"}}]}}},"copyright":{"name":"copyright","label":"Copyright","type":"text","data":"@Copyright Uasoft 2024. All Rights Reserved"}}}}',
'created_at' => '2024-03-05 08:07:16',
'updated_at' => '2024-03-20 07:11:57',
],
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
<?php

namespace Database\Seeders\Badaso\Commerce\Theme\ComfreeTheme\ManualGenerateComfreeTheme;

use Illuminate\Database\Seeder;
use Uasoft\Badaso\Traits\Seedable;

class BadasoComfreeManualGenerateSeeder extends Seeder
{
use Seedable;

protected $seedersPath = 'database/seeds/Badaso/ManualGenerate/';

public function run()
{
$this->seed(BadasoDiscountsTableSeeder::class);
$this->seed(BadasoProductsTableSeeder::class);
$this->seed(BadasoProductDetailsTableSeeder::class);
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
<?php

namespace Database\Seeders\Badaso\Commerce\Theme\ComfreeTheme\ManualGenerateComfreeTheme;

use Illuminate\Database\Seeder;
use Uasoft\Badaso\Facades\Badaso;

class BadasoDiscountsTableSeeder extends Seeder
{
/**
* Auto generated seed file
*
* @return void
*
* @throws Exception
*/
public function run()
{
\DB::beginTransaction();
try {
\DB::table('badaso_discounts')->delete();

\DB::table('badaso_discounts')->insert(array (
0 =>
array (
'id' => 1,
'name' => 'Gebyar Diskon Merdeka',
'desc' => NULL,
'discount_type' => 'fixed',
'discount_percent' => NULL,
'discount_fixed' => 20000.0,
'active' => 0,
'created_at' => '2024-08-23 08:44:46',
'updated_at' => '2024-08-23 08:44:46',
'deleted_at' => NULL,
),
));

\DB::commit();
} catch(Exception $e) {
\DB::rollBack();

throw new Exception('Exception occur ' . $e);
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,6 @@ public function run()
{
\DB::beginTransaction();
try {
\DB::table('badaso_product_categories')->delete();

\DB::table('badaso_product_categories')->insert(array (
0 =>
array (
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,144 @@
<?php

namespace Database\Seeders\Badaso\Commerce\Theme\ComfreeTheme\ManualGenerateComfreeTheme;

use Illuminate\Database\Seeder;
use Uasoft\Badaso\Facades\Badaso;

class BadasoProductDetailsTableSeeder extends Seeder
{
/**
* Auto generated seed file
*
* @return void
*
* @throws Exception
*/
public function run()
{
\DB::beginTransaction();
try {

\DB::table('badaso_product_details')->insert(array (
0 =>
array (
'id' => 1,
'product_id' => 1,
'discount_id' => 1,
'name' => 'Waxed Canvas Messenger Bag',
'quantity' => 10,
'price' => 580000.0,
'SKU' => 'SKU',
'product_image' => 'https://demo.saudagarwp.com/wp-content/uploads/sites/3/2019/01/bag-navy-3-300x300.webp',
'created_at' => '2024-08-23 08:48:30',
'updated_at' => '2024-08-23 08:48:30',
'deleted_at' => NULL,
),
1 =>
array (
'id' => 2,
'product_id' => 2,
'discount_id' => 1,
'name' => 'Do What You Love',
'quantity' => 15,
'price' => 320000.0,
'SKU' => 'SKU',
'product_image' => 'https://demo.saudagarwp.com/wp-content/uploads/sites/3/2019/01/do-what-1-300x300.webp',
'created_at' => '2024-08-23 09:06:53',
'updated_at' => '2024-08-23 09:06:53',
'deleted_at' => NULL,
),
2 =>
array (
'id' => 3,
'product_id' => 3,
'discount_id' => NULL,
'name' => 'And Then I Woke Up',
'quantity' => 20,
'price' => 320000.0,
'SKU' => 'SKU',
'product_image' => 'https://demo.saudagarwp.com/wp-content/uploads/sites/3/2019/01/and-then-3-150x150.webp',
'created_at' => '2024-08-23 09:09:39',
'updated_at' => '2024-08-23 09:09:39',
'deleted_at' => NULL,
),
3 =>
array (
'id' => 4,
'product_id' => 4,
'discount_id' => 1,
'name' => 'Waxed Canvas Messenger Bag Edition',
'quantity' => 10,
'price' => 580000.0,
'SKU' => 'SKU',
'product_image' => 'https://demo.saudagarwp.com/wp-content/uploads/sites/3/2019/01/charcoal-messenger-6-300x300.webp',
'created_at' => '2024-08-23 09:12:01',
'updated_at' => '2024-08-23 09:12:01',
'deleted_at' => NULL,
),
4 =>
array (
'id' => 5,
'product_id' => 5,
'discount_id' => NULL,
'name' => 'Mountains Baseball Cap',
'quantity' => 10,
'price' => 150000.0,
'SKU' => 'SKU',
'product_image' => 'https://demo.saudagarwp.com/wp-content/uploads/sites/3/2019/01/cap-2-300x300.webp',
'created_at' => '2024-08-23 09:14:59',
'updated_at' => '2024-08-23 09:14:59',
'deleted_at' => NULL,
),
5 =>
array (
'id' => 6,
'product_id' => 6,
'discount_id' => NULL,
'name' => 'Minimize',
'quantity' => 10,
'price' => 150000.0,
'SKU' => 'SKU',
'product_image' => 'https://demo.saudagarwp.com/wp-content/uploads/sites/3/2019/01/min-green-4-300x300.webp',
'created_at' => '2024-08-23 09:17:40',
'updated_at' => '2024-08-23 09:17:40',
'deleted_at' => NULL,
),
6 =>
array (
'id' => 7,
'product_id' => 7,
'discount_id' => NULL,
'name' => 'Chunky Knit Beanie',
'quantity' => 10,
'price' => 150000.0,
'SKU' => 'SKU',
'product_image' => 'https://demo.saudagarwp.com/wp-content/uploads/sites/3/2019/01/beanies-5-300x300.webp',
'created_at' => '2024-08-23 09:20:07',
'updated_at' => '2024-08-23 09:20:07',
'deleted_at' => NULL,
),
7 =>
array (
'id' => 8,
'product_id' => 8,
'discount_id' => NULL,
'name' => 'Carry On',
'quantity' => 10,
'price' => 480000.0,
'SKU' => 'SKU',
'product_image' => 'https://demo.saudagarwp.com/wp-content/uploads/sites/3/2019/01/carri-on-4-300x300.webp',
'created_at' => '2024-08-23 09:21:59',
'updated_at' => '2024-08-23 09:21:59',
'deleted_at' => NULL,
),
));

\DB::commit();
} catch(Exception $e) {
\DB::rollBack();

throw new Exception('Exception occur ' . $e);
}
}
}
Loading