WIP
This commit is contained in:
@@ -32,13 +32,13 @@ class CartController extends Controller
|
|||||||
});
|
});
|
||||||
|
|
||||||
$data = $cartItems->map(fn ($cartItem) => [
|
$data = $cartItems->map(fn ($cartItem) => [
|
||||||
'id' => $cartItem->id,
|
'id' => $cartItem->id,
|
||||||
'user_id' => $cartItem->user_id,
|
'user_id' => $cartItem->user_id,
|
||||||
'product_id' => $cartItem->product_id,
|
'product_id' => $cartItem->product_id,
|
||||||
'product_quantity' => $cartItem->product_quantity,
|
'product_quantity' => $cartItem->product_quantity,
|
||||||
'created_at' => $cartItem->created_at,
|
'created_at' => $cartItem->created_at,
|
||||||
'updated_at' => $cartItem->updated_at,
|
'updated_at' => $cartItem->updated_at,
|
||||||
'product' => new ProductResource($cartItem->product),
|
'product' => new ProductResource($cartItem->product),
|
||||||
])->groupBy(function (array $cartItem) {
|
])->groupBy(function (array $cartItem) {
|
||||||
if (isset($cartItem['product']) && $cartItem['product']->channels->count() > 0) {
|
if (isset($cartItem['product']) && $cartItem['product']->channels->count() > 0) {
|
||||||
return $cartItem['product']->channels[0]->slug;
|
return $cartItem['product']->channels[0]->slug;
|
||||||
|
|||||||
@@ -5,8 +5,8 @@ namespace App\Repositories\Ecommerce\Order;
|
|||||||
use App\Events\Ecommerce\Product\Order\OrderCreated;
|
use App\Events\Ecommerce\Product\Order\OrderCreated;
|
||||||
use App\Models\Ecommerce\Product\Order\Order;
|
use App\Models\Ecommerce\Product\Order\Order;
|
||||||
use App\Models\Ecommerce\Product\Order\Shipping\OrderShipping;
|
use App\Models\Ecommerce\Product\Order\Shipping\OrderShipping;
|
||||||
use Illuminate\Support\Facades\DB;
|
|
||||||
use Illuminate\Support\Arr;
|
use Illuminate\Support\Arr;
|
||||||
|
use Illuminate\Support\Facades\DB;
|
||||||
|
|
||||||
class OrderRepository
|
class OrderRepository
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -3,7 +3,6 @@
|
|||||||
namespace App\Repositories\Ecommerce\Product\Category;
|
namespace App\Repositories\Ecommerce\Product\Category;
|
||||||
|
|
||||||
use App\Models\Ecommerce\Product\Category\Category;
|
use App\Models\Ecommerce\Product\Category\Category;
|
||||||
use App\Repositories\System\Cache\CacheRepository;
|
|
||||||
use Illuminate\Http\Request;
|
use Illuminate\Http\Request;
|
||||||
|
|
||||||
class CategoryRepository
|
class CategoryRepository
|
||||||
@@ -126,14 +125,11 @@ class CategoryRepository
|
|||||||
*/
|
*/
|
||||||
public static function namesWithTaxes(): array
|
public static function namesWithTaxes(): array
|
||||||
{
|
{
|
||||||
return CacheRepository::make(
|
return static::maskParentName(
|
||||||
name: 'cs-nova-models-categories',
|
Category::tree()
|
||||||
value: fn () => static::maskParentName(
|
->where('is_visible', true)
|
||||||
Category::tree()
|
->get(['id', 'slug', 'name', 'tax_percentage', 'parent_id', 'is_visible'])
|
||||||
->where('is_visible', true)
|
->toTree()
|
||||||
->get(['id', 'slug', 'name', 'tax_percentage', 'parent_id', 'is_visible'])
|
|
||||||
->toTree()
|
|
||||||
)
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
namespace Database\Seeders;
|
namespace Database\Seeders;
|
||||||
|
|
||||||
use File;
|
use Illuminate\Support\Facades\File;
|
||||||
use Illuminate\Database\Seeder;
|
use Illuminate\Database\Seeder;
|
||||||
use Illuminate\Support\Facades\DB;
|
use Illuminate\Support\Facades\DB;
|
||||||
|
|
||||||
|
|||||||
@@ -3,7 +3,7 @@
|
|||||||
namespace Database\Seeders;
|
namespace Database\Seeders;
|
||||||
|
|
||||||
use App\Models\Ecommerce\Channel\Channel;
|
use App\Models\Ecommerce\Channel\Channel;
|
||||||
use File;
|
use Illuminate\Support\Facades\File;
|
||||||
use Illuminate\Database\Seeder;
|
use Illuminate\Database\Seeder;
|
||||||
use Illuminate\Support\Facades\DB;
|
use Illuminate\Support\Facades\DB;
|
||||||
|
|
||||||
|
|||||||
@@ -23,12 +23,12 @@ class DatabaseSeeder extends Seeder
|
|||||||
ChannelTableSeeder::class,
|
ChannelTableSeeder::class,
|
||||||
PaymentTypeTableSeeder::class,
|
PaymentTypeTableSeeder::class,
|
||||||
ProvinceTableSeeder::class,
|
ProvinceTableSeeder::class,
|
||||||
BrandTableSeeder::class,
|
// BrandTableSeeder::class,
|
||||||
// ProductTableSeeder::class,
|
// ProductTableSeeder::class,
|
||||||
PostBranchTableSeeder::class,
|
// PostBranchTableSeeder::class,
|
||||||
// InventoriesTableSeeder::class,
|
// InventoriesTableSeeder::class,
|
||||||
CategoryTableSeeder::class,
|
// CategoryTableSeeder::class,
|
||||||
CollectionTableSeeder::class,
|
// CollectionTableSeeder::class,
|
||||||
// AttributeTableSeeder::class,
|
// AttributeTableSeeder::class,
|
||||||
// ContactUsTableSeeder::class,
|
// ContactUsTableSeeder::class,
|
||||||
LegalPageTableSeeder::class,
|
LegalPageTableSeeder::class,
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ namespace Database\Seeders;
|
|||||||
|
|
||||||
use App\Models\Legal\LegalPage;
|
use App\Models\Legal\LegalPage;
|
||||||
use Exception;
|
use Exception;
|
||||||
use File;
|
use Illuminate\Support\Facades\File;
|
||||||
use Illuminate\Database\Seeder;
|
use Illuminate\Database\Seeder;
|
||||||
use Illuminate\Support\Facades\DB;
|
use Illuminate\Support\Facades\DB;
|
||||||
|
|
||||||
|
|||||||
@@ -29,14 +29,6 @@ class PaymentTypeTableSeeder extends Seeder
|
|||||||
'is_enabled' => true,
|
'is_enabled' => true,
|
||||||
'options' => null,
|
'options' => null,
|
||||||
],
|
],
|
||||||
[
|
|
||||||
'id' => 3,
|
|
||||||
'code' => 'online_halkbank',
|
|
||||||
'name' => ['en' => 'Online (halkbank)', 'tk' => 'Onlaýn (halkbank)', 'ru' => 'Onlaýn (halkbank)'],
|
|
||||||
'tax' => 0,
|
|
||||||
'is_enabled' => true,
|
|
||||||
'options' => null,
|
|
||||||
],
|
|
||||||
])->each(fn ($data) => PaymentType::create($data));
|
])->each(fn ($data) => PaymentType::create($data));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3,7 +3,7 @@
|
|||||||
namespace Database\Seeders;
|
namespace Database\Seeders;
|
||||||
|
|
||||||
use Exception;
|
use Exception;
|
||||||
use File;
|
use Illuminate\Support\Facades\File;
|
||||||
use Illuminate\Database\Seeder;
|
use Illuminate\Database\Seeder;
|
||||||
use Illuminate\Support\Facades\DB;
|
use Illuminate\Support\Facades\DB;
|
||||||
|
|
||||||
|
|||||||
@@ -31,6 +31,12 @@ class UserTableSeeder extends Seeder
|
|||||||
'email' => 'nurmuhammet@mail.com',
|
'email' => 'nurmuhammet@mail.com',
|
||||||
'password' => bcrypt('payload10'),
|
'password' => bcrypt('payload10'),
|
||||||
],
|
],
|
||||||
|
[
|
||||||
|
'first_name' => 'Admin',
|
||||||
|
'last_name' => 'Admin',
|
||||||
|
'email' => 'admin@smartelektronika.com',
|
||||||
|
'password' => bcrypt('PuteraSeroja'),
|
||||||
|
]
|
||||||
])->each(function ($data) {
|
])->each(function ($data) {
|
||||||
$user = User::create($data);
|
$user = User::create($data);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user