diff --git a/config/app.php b/config/app.php index 0fc11f7..707173c 100644 --- a/config/app.php +++ b/config/app.php @@ -281,7 +281,7 @@ return [ Webkul\DebugBar\Providers\DebugBarServiceProvider::class, Webkul\Marketing\Providers\MarketingServiceProvider::class, Webkul\Notification\Providers\NotificationServiceProvider::class, - // Webkul\Marketplace\Providers\MarketplaceServiceProvider::class, + Webkul\Marketplace\Providers\MarketplaceServiceProvider::class, Sarga\Shop\Providers\ShopServiceProvider::class, Sarga\API\Providers\APIServiceProvider::class, diff --git a/packages/Sarga/API/Http/Controllers/Brands.php b/packages/Sarga/API/Http/Controllers/Brands.php index 33c05a3..4837a3b 100644 --- a/packages/Sarga/API/Http/Controllers/Brands.php +++ b/packages/Sarga/API/Http/Controllers/Brands.php @@ -25,10 +25,10 @@ class Brands extends \Webkul\RestApi\Http\Controllers\V1\Shop\ResourceController * * @return string */ - public function repository() - { - return BrandRepository::class; - } + // public function repository() + // { + // return BrandRepository::class; + // } /** * Resource class name. diff --git a/packages/Sarga/API/Http/Controllers/Products.php b/packages/Sarga/API/Http/Controllers/Products.php index 7edd6d8..ff4212c 100644 --- a/packages/Sarga/API/Http/Controllers/Products.php +++ b/packages/Sarga/API/Http/Controllers/Products.php @@ -8,7 +8,7 @@ use Sarga\API\Http\Resources\Catalog\HomeResource; use Sarga\API\Http\Resources\Catalog\ProductVariant; use Sarga\API\Http\Resources\Catalog\Suggestion; use Sarga\API\Http\Resources\Catalog\SuperAttribute; -use Sarga\Brand\Repositories\BrandRepository; +// use Sarga\Brand\Repositories\BrandRepository; use Sarga\Shop\Repositories\ProductRepository; use Webkul\API\Http\Controllers\Shop\ProductController; use Sarga\API\Http\Resources\Catalog\Product as ProductResource; diff --git a/packages/Sarga/API/Http/Controllers/SearchController.php b/packages/Sarga/API/Http/Controllers/SearchController.php index 632480f..266d4f9 100644 --- a/packages/Sarga/API/Http/Controllers/SearchController.php +++ b/packages/Sarga/API/Http/Controllers/SearchController.php @@ -3,7 +3,7 @@ namespace Sarga\API\Http\Controllers; use Sarga\API\Http\Resources\Catalog\Suggestion; -use Sarga\Brand\Repositories\BrandRepository; +// use Sarga\Brand\Repositories\BrandRepository; use Sarga\Shop\Repositories\CategoryRepository; use Webkul\Category\Models\CategoryTranslationProxy; use Webkul\Product\Repositories\ProductFlatRepository; @@ -11,7 +11,7 @@ use Webkul\RestApi\Http\Controllers\V1\V1Controller; class SearchController extends V1Controller { - public function __construct(protected BrandRepository $brandRepository, + public function __construct( protected ProductFlatRepository $productFlatRepository, protected CategoryRepository $categoryRepository) { diff --git a/packages/Sarga/API/Http/Controllers/Vendors.php b/packages/Sarga/API/Http/Controllers/Vendors.php index da8c9a3..c7bcbe9 100644 --- a/packages/Sarga/API/Http/Controllers/Vendors.php +++ b/packages/Sarga/API/Http/Controllers/Vendors.php @@ -9,7 +9,7 @@ use Sarga\API\Http\Resources\Core\Vendor; use Sarga\API\Http\Resources\Core\Review; use Sarga\API\Http\Resources\Core\VendorDetail; use Sarga\Shop\Repositories\ProductRepository; -use Sarga\Brand\Repositories\BrandRepository; +// use Sarga\Brand\Repositories\BrandRepository; use Sarga\Shop\Repositories\CategoryRepository; use Sarga\Shop\Models\Category; use Webkul\Marketplace\Repositories\ReviewRepository; @@ -72,7 +72,7 @@ class Vendors extends V1Controller $item->review_average = $this->reviewRepository->getAverageRating($item); return $item; }); - + return Vendor::collection($reviewed_vendors); } @@ -104,7 +104,7 @@ class Vendors extends V1Controller // dd($vendor->categories()->first()); $vendor->review_average = $this->reviewRepository->getAverageRating($vendor); - + // $vendor->reviews = $this->reviewRepository // ->where('marketplace_seller_id', $seller_id) // ->where('status', 'approved') @@ -118,8 +118,8 @@ class Vendors extends V1Controller // return Review::collection($reviews); // } - public function brands(BrandRepository $brandRepository, $seller_id){ + // public function brands(BrandRepository $brandRepository, $seller_id){ - return Brand::collection($brandRepository->findAllBySeller($seller_id)); - } + // return Brand::collection($brandRepository->findAllBySeller($seller_id)); + // } } \ No newline at end of file diff --git a/packages/Sarga/API/Http/Resources/Catalog/Product.php b/packages/Sarga/API/Http/Resources/Catalog/Product.php index e4dd147..52a2f0b 100644 --- a/packages/Sarga/API/Http/Resources/Catalog/Product.php +++ b/packages/Sarga/API/Http/Resources/Catalog/Product.php @@ -50,12 +50,12 @@ class Product extends JsonResource 'in_stock' => $product->haveSufficientQuantity(1), 'is_wishlisted' => $this->isWishlisted($product) , 'is_item_in_cart' => \Cart::hasProduct($product), - 'shop_title' => $this->shop_title, - 'logo' => $this->logo ? Storage::url($this->logo) : null, + //'shop_title' => $this->shop_title, + //'logo' => $this->logo ? Storage::url($this->logo) : null, 'new' => $this->new, 'featured' => $this->featured, // 'brand' => $product->brand->name ?? '', - + // 'show_quantity_changer' => $this->when( // $product->type !== 'grouped', diff --git a/packages/Sarga/Brand/composer.json b/packages/Sarga/Brand/composer.json deleted file mode 100644 index 3a80c21..0000000 --- a/packages/Sarga/Brand/composer.json +++ /dev/null @@ -1,27 +0,0 @@ -{ - "name": "sarga/bagisto-brand", - "license": "MIT", - "authors": [ - { - "name": "Merdan Singh", - "email": "merdan.m@gmail.com" - } - ], - "require": { - "bagisto/laravel-core": "dev-master" - }, - "autoload": { - "psr-4": { - "Sarga\\Brand\\": "src/" - } - }, - "extra": { - "laravel": { - "providers": [ - "Sarga\\Brand\\Providers\\BrandServiceProvider" - ], - "aliases": {} - } - }, - "minimum-stability": "dev" -} \ No newline at end of file diff --git a/packages/Sarga/Brand/src/Config/concord.php b/packages/Sarga/Brand/src/Config/concord.php deleted file mode 100644 index a07af6b..0000000 --- a/packages/Sarga/Brand/src/Config/concord.php +++ /dev/null @@ -1,4 +0,0 @@ - 'catalog.brand', - // 'name' => 'brand::app.brands', - // 'route' => 'admin.catalog.brand.index', - // 'sort' => 5, - // 'icon-class' => '', - // ] -]; \ No newline at end of file diff --git a/packages/Sarga/Brand/src/Contracts/Brand.php b/packages/Sarga/Brand/src/Contracts/Brand.php deleted file mode 100644 index a0ecb27..0000000 --- a/packages/Sarga/Brand/src/Contracts/Brand.php +++ /dev/null @@ -1,7 +0,0 @@ -addFilter('code', 'br.code'); - $this->addFilter('name', 'br.name'); - $this->addFilter('status', 'br.status'); - $this->setQueryBuilder($queryBuilder); - } - - public function addColumns() - { - $this->addColumn([ - 'index' => 'id', - 'label' => trans('admin::app.datagrid.id'), - 'type' => 'number', - 'searchable' => false, - 'sortable' => true, - 'filterable' => true, - ]); - - $this->addColumn([ - 'index' => 'code', - 'label' => trans('admin::app.datagrid.code'), - 'type' => 'string', - 'searchable' => true, - 'sortable' => true, - 'filterable' => true, - ]); - - $this->addColumn([ - 'index' => 'name', - 'label' => trans('admin::app.datagrid.name'), - 'type' => 'string', - 'searchable' => true, - 'sortable' => true, - 'filterable' => true, - ]); - $this->addColumn([ - 'index' => 'position', - 'label' => trans('admin::app.datagrid.position'), - 'type' => 'number', - 'searchable' => false, - 'sortable' => true, - 'filterable' => true, - ]); - - $this->addColumn([ - 'index' => 'status', - 'label' => trans('admin::app.datagrid.status'), - 'type' => 'boolean', - 'sortable' => true, - 'searchable' => true, - 'filterable' => true, - 'closure' => function ($value) { - if ($value->status == 1) { - return trans('admin::app.datagrid.active'); - } else { - return trans('admin::app.datagrid.inactive'); - } - }, - ]); - } - - /** - * Prepare actions. - * - * @return void - */ - public function prepareActions() - { - $this->addAction([ - 'title' => trans('admin::app.datagrid.edit'), - 'method' => 'GET', - 'route' => 'admin.catalog.brand.edit', - 'icon' => 'icon pencil-lg-icon', - ]); - - $this->addAction([ - 'title' => trans('admin::app.datagrid.delete'), - 'method' => 'POST', - 'route' => 'admin.catalog.brand.delete', - 'confirm_text' => trans('ui::app.datagrid.massaction.delete', ['resource' => 'brand']), - 'icon' => 'icon trash-icon', - 'function' => 'deleteCategory(event, "delete")' - ]); - - $this->addMassAction([ - 'type' => 'delete', - 'label' => trans('admin::app.datagrid.delete'), - 'action' => route('admin.catalog.brand.massdelete'), - 'method' => 'POST', - ]); - } -} \ No newline at end of file diff --git a/packages/Sarga/Brand/src/Database/Migrations/2022_01_24_130148_create_brands_table.php b/packages/Sarga/Brand/src/Database/Migrations/2022_01_24_130148_create_brands_table.php deleted file mode 100644 index 04c39e8..0000000 --- a/packages/Sarga/Brand/src/Database/Migrations/2022_01_24_130148_create_brands_table.php +++ /dev/null @@ -1,69 +0,0 @@ -increments('id'); - $table->string('code')->unique(); - $table->string('name'); - $table->integer('position')->default(0); - $table->string('image')->nullable(); - $table->boolean('status')->default(0); - $table->timestamps(); - }); - - Schema::create('category_brands',function (Blueprint $table) { - $table->integer('category_id')->unsigned(); - $table->integer('brand_id')->unsigned(); - $table->foreign('category_id')->references('id')->on('categories')->onDelete('cascade'); - $table->foreign('brand_id')->references('id')->on('brands')->onDelete('cascade'); - }); - -// Schema::create('product_brands',function (Blueprint $table) { -// $table->integer('product_id')->unsigned(); -// $table->integer('brand_id')->unsigned(); -// $table->foreign('product_id')->references('id')->on('products')->onDelete('cascade'); -// $table->foreign('brand_id')->references('id')->on('brands')->onDelete('cascade'); -// }); - - Schema::table('products', function (Blueprint $table) { - $table->integer('brand_id')->unsigned()->nullable(); - $table->foreign('brand_id')->references('id')->on('brands')->onDelete('set null'); - }); - - Schema::create('seller_brands',function (Blueprint $table) { - $table->integer('seller_id')->unsigned(); - $table->integer('brand_id')->unsigned(); - $table->foreign('seller_id')->references('id')->on('marketplace_sellers')->onDelete('cascade'); - $table->foreign('brand_id')->references('id')->on('brands')->onDelete('cascade'); - }); - } - - /** - * Reverse the migrations. - * - * @return void - */ - public function down() - { - Schema::table('products', function (Blueprint $table) { - $table->dropColumn('brand_id'); - }); - - Schema::dropIfExists('category_brands'); -// Schema::dropIfExists('product_brands'); - Schema::dropIfExists('seller_brands'); - Schema::dropIfExists('brands'); - } -} diff --git a/packages/Sarga/Brand/src/Database/Migrations/2022_02_01_130149_add_brandid_to_product_flat_table.php b/packages/Sarga/Brand/src/Database/Migrations/2022_02_01_130149_add_brandid_to_product_flat_table.php deleted file mode 100644 index 76a2051..0000000 --- a/packages/Sarga/Brand/src/Database/Migrations/2022_02_01_130149_add_brandid_to_product_flat_table.php +++ /dev/null @@ -1,24 +0,0 @@ -integer('brand_id')->unsigned()->nullable(); - $table->foreign('brand_id')->references('id')->on('brands')->onDelete('set null'); - }); - } - /** - * Reverse the migrations. - * - * @return void - */ - public function down() - { - Schema::table('product_flat', function (Blueprint $table) { - $table->dropColumn('brand_id'); - }); - } -} \ No newline at end of file diff --git a/packages/Sarga/Brand/src/Http/Controllers/BrandController.php b/packages/Sarga/Brand/src/Http/Controllers/BrandController.php deleted file mode 100644 index e4a4fa4..0000000 --- a/packages/Sarga/Brand/src/Http/Controllers/BrandController.php +++ /dev/null @@ -1,108 +0,0 @@ -brandRepository = $brandRepository; - $this->sellerRepository = $sellerRepository; - $this->categoryRepository = $categoryRepository; - $this->_config = request('_config'); - } - - public function index() { - return view($this->_config['view']); - } - - public function create(){ - $sellers = $this->sellerRepository->findByField('is_approved',1); - $categories = $this->categoryRepository->getCategoryTree(); - return view($this->_config['view'],compact('sellers','categories')); - } - - public function store(){ - $this->validate(request(), [ - 'code' => ['required', 'unique:brands,code', new \Webkul\Core\Contracts\Validations\Code], - 'name' => 'required', - 'position' => 'numeric', - 'status' => 'numeric', - 'image.*' => 'mimes:bmp,jpeg,jpg,png,webp', - ]); - - $this->brandRepository->create(request()->all()); - - session()->flash('success', trans('admin::app.response.create-success', ['name' => 'Brand'])); - - return redirect()->route($this->_config['redirect']); - } - - public function edit($id){ - $brand = $this->brandRepository->find($id); - $sellers = $this->sellerRepository->findByField('is_approved',1); - $categories = $this->categoryRepository->getCategoryTree(); - return view($this->_config['view'], compact('brand','sellers','categories')); - } - - public function update($id){ - $this->validate(request(), [ - 'code' => ['required', 'unique:brands,code,'. $id, new \Webkul\Core\Contracts\Validations\Code], - 'name' => 'required', - 'position' => 'numeric', - 'status' => 'numeric', - 'image.*' => 'mimes:bmp,jpeg,jpg,png,webp', - ]); - - $this->brandRepository->update(request()->all(), $id); - - session()->flash('success', trans('admin::app.response.update-success', ['name' => 'Brand'])); - - return redirect()->route($this->_config['redirect']); - } - - public function destroy($id){ - try { - - $this->brandRepository->delete($id); - - session()->flash('success', trans('admin::app.response.delete-success', ['name' => 'Brand'])); - - return response()->json(['message' => true], 200); - } catch (\Exception $e) { - session()->flash('error', trans('admin::app.response.delete-failed', ['name' => 'Brand'])); - } - } - - public function massDestroy(){ - - $brandIds = explode(',', request()->input('indexes')); - - try { - - $this->brandRepository->destroy($brandIds); - session()->flash('success', trans('admin::app.response.delete-success', ['name' => 'Brand'])); - - } catch (\Exception $e) { - session()->flash('error', trans('admin::app.response.delete-failed', ['name' => 'Brand'])); - } - return redirect()->route($this->_config['redirect']); - } - -} \ No newline at end of file diff --git a/packages/Sarga/Brand/src/Http/Controllers/Controller.php b/packages/Sarga/Brand/src/Http/Controllers/Controller.php deleted file mode 100644 index aaa52cf..0000000 --- a/packages/Sarga/Brand/src/Http/Controllers/Controller.php +++ /dev/null @@ -1,13 +0,0 @@ -image) { - return; - } - - return Storage::url($this->image); - } - - /** - * Get image url for the category image. - */ - public function getImageUrlAttribute() - { - return $this->image_url(); - } - - /** - * The products that belong to the category. - */ - public function products(): HasMany - { - return $this->hasMany(ProductProxy::modelClass(), 'brand_id'); - } - - public function sellers():BelongsToMany - { - return $this->belongsToMany(SellerProxy::modelClass(), 'seller_brands'); - } - - public function categories():BelongsToMany - { - return $this->belongsToMany(CategoryProxy::modelClass(), 'category_brands'); - } -} \ No newline at end of file diff --git a/packages/Sarga/Brand/src/Models/BrandProxy.php b/packages/Sarga/Brand/src/Models/BrandProxy.php deleted file mode 100644 index 5e47bb4..0000000 --- a/packages/Sarga/Brand/src/Models/BrandProxy.php +++ /dev/null @@ -1,8 +0,0 @@ -loadMigrationsFrom(__DIR__ . '/../Database/Migrations'); - // $this->loadRoutesFrom(__DIR__ . '/../Routes/brand-routes.php'); - // $this->loadViewsFrom(__DIR__ . '/../Resources/views', 'brand'); - // $this->loadTranslationsFrom(__DIR__ . '/../Resources/lang', 'brand'); -// Log::info('brandd service provider'); - $this->app->register(EventServiceProvider::class); -// CategoryProxy::observe(CategoryObserver::class); - } - - public function register() - { - // $this->mergeConfigFrom( - // dirname(__DIR__) . '/Config/menu.php', - // 'menu.admin' - // ); - - // $this->mergeConfigFrom( - // dirname(__DIR__) . '/Config/concord.php', - // 'concord.modules' - // ); - } -} \ No newline at end of file diff --git a/packages/Sarga/Brand/src/Providers/EventServiceProvider.php b/packages/Sarga/Brand/src/Providers/EventServiceProvider.php deleted file mode 100644 index 258cbda..0000000 --- a/packages/Sarga/Brand/src/Providers/EventServiceProvider.php +++ /dev/null @@ -1,23 +0,0 @@ -addTemplate('brand::admin.catalog.products.fields.brand'); - - }); - } -} \ No newline at end of file diff --git a/packages/Sarga/Brand/src/Providers/ModuleServiceProvider.php b/packages/Sarga/Brand/src/Providers/ModuleServiceProvider.php deleted file mode 100644 index a37c452..0000000 --- a/packages/Sarga/Brand/src/Providers/ModuleServiceProvider.php +++ /dev/null @@ -1,12 +0,0 @@ -model->create($data); - - if(isset($data['sellers'])){ - $brand->sellers()->sync($data['sellers']); - } - - if(isset($data['categories'])){ - $brand->categories()->sync($data['categories']); - } - - $this->uploadImages($brand,$data); - - return $brand; - } - - public function update(array $data, $id){ - - $brand = $this->find($id); - - $brand->update($data); - - $this->uploadImages($brand, $data); - - if(isset($data['sellers'])){ - $brand->sellers()->sync($data['sellers']); - } - - if(isset($data['categories'])){ - $brand->categories()->sync($data['categories']); - } - - return $brand; - - } - - public function uploadImages($brand,$data,$type = 'image') { - if (isset($data[$type])) { - $request = request(); - - foreach ($data[$type] as $imageId => $image) { - $file = $type . '.' . $imageId; - $dir = 'brand/' . $brand->id; - - if ($request->hasFile($file)) { - if ($brand->{$type}) { - Storage::delete($brand->{$type}); - } - - $brand->{$type} = $request->file($file)->store($dir); - $brand->save(); - } - } - } else { - if ($brand->{$type}) { - Storage::delete($brand->{$type}); - } - - $brand->{$type} = null; - $brand->save(); - } - } - - public function actives(){ - return $this->findByField('status',1); - } - - public function findAllBySeller($seller_id){ - $query = $this->leftJoin('seller_brands as sb','sb.brand_id','=','brands.id') - ->where('sb.seller_id',$seller_id); - - if(request()->has('category_id')){ - $query->leftJoin('category_brands as cb','cb.brand_id','=','brands.id') - ->where('cb.category_id',request()->get('category_id')); - } - - $limit = request()->get('limit') ?? 10; - $page = request()->get('page') ?? 1; - - return $query->orderBy('position', 'ASC') - ->skip(($page-1) * $limit) - ->take($limit) - ->get(); - } -} \ No newline at end of file diff --git a/packages/Sarga/Brand/src/Resources/lang/en/app.php b/packages/Sarga/Brand/src/Resources/lang/en/app.php deleted file mode 100644 index dc26d66..0000000 --- a/packages/Sarga/Brand/src/Resources/lang/en/app.php +++ /dev/null @@ -1,10 +0,0 @@ - 'Brand', - 'brands' => 'Brands', - 'add_brand' => 'Add Brand', - 'edit_brand' => 'Edit Brand', - 'save_brand' => 'Save Brand', - 'code' => 'Brand Code', - 'name' => 'Brand Name', -]; diff --git a/packages/Sarga/Brand/src/Resources/lang/tm/app.php b/packages/Sarga/Brand/src/Resources/lang/tm/app.php deleted file mode 100644 index 7563dc7..0000000 --- a/packages/Sarga/Brand/src/Resources/lang/tm/app.php +++ /dev/null @@ -1,10 +0,0 @@ - 'Brand', - 'brands' => 'Brands tt', - 'add_brand' => 'Add Brand', - 'edit_brand' => 'Edit Brand', - 'save_brand' => 'Save Brand', - 'code' => 'Brand Code', - 'name' => 'Brand Name', -]; diff --git a/packages/Sarga/Brand/src/Resources/lang/tr/app.php b/packages/Sarga/Brand/src/Resources/lang/tr/app.php deleted file mode 100644 index f914dd4..0000000 --- a/packages/Sarga/Brand/src/Resources/lang/tr/app.php +++ /dev/null @@ -1,5 +0,0 @@ - 'Marka', - 'brands' => 'Markalar' -]; diff --git a/packages/Sarga/Brand/src/Resources/views/admin/catalog/brand/create.blade.php b/packages/Sarga/Brand/src/Resources/views/admin/catalog/brand/create.blade.php deleted file mode 100644 index 3ac86ef..0000000 --- a/packages/Sarga/Brand/src/Resources/views/admin/catalog/brand/create.blade.php +++ /dev/null @@ -1,117 +0,0 @@ -@extends('admin::layouts.content') - -@section('page_title') - {{ __('brand::app.add_brand') }} -@stop - -@section('content') -
-
- -
-
- @csrf() - -
- -
- - - @{{ errors.first('code') }} -
-
- - - @{{ errors.first('name') }} -
-
- - - @{{ errors.first('status') }} -
- -
- - - @{{ errors.first('position') }} -
-
-
- - -
- -
- - - - - - @foreach ($errors->get('image.*') as $key => $message) - @php echo str_replace($key, 'Image', $message[0]); @endphp - @endforeach - -
- - {!! view_render_event('bagisto.admin.catalog.category.create_form_accordian.description_images.controls.after') !!} -
-
- -
-
- - - - @{{ errors.first('sellers[]') }} - -
-
-
- @if ($categories->count()) - - -
- - - - -
-
- @endif -
-
-
-
-@stop \ No newline at end of file diff --git a/packages/Sarga/Brand/src/Resources/views/admin/catalog/brand/edit.blade.php b/packages/Sarga/Brand/src/Resources/views/admin/catalog/brand/edit.blade.php deleted file mode 100644 index 577d679..0000000 --- a/packages/Sarga/Brand/src/Resources/views/admin/catalog/brand/edit.blade.php +++ /dev/null @@ -1,119 +0,0 @@ -@extends('admin::layouts.content') - -@section('page_title') - {{ __('brand::app.add_brand') }} -@stop - -@section('content') -
-
- -
-
- @csrf() - -
- -
- - - @{{ errors.first('code') }} -
-
- - - @{{ errors.first('name') }} -
-
- - - @{{ errors.first('status') }} -
- -
- - - @{{ errors.first('position') }} -
-
-
- - -
- -
- - - - - - @foreach ($errors->get('image.*') as $key => $message) - @php echo str_replace($key, 'Image', $message[0]); @endphp - @endforeach - -
- - {!! view_render_event('bagisto.admin.catalog.category.create_form_accordian.description_images.controls.after') !!} -
-
- -
-
- - - - @{{ errors.first('sellers[]') }} - -
-
-
- @if ($categories->count()) - - -
- - - - -
-
- @endif -
-
-
-
-@stop \ No newline at end of file diff --git a/packages/Sarga/Brand/src/Resources/views/admin/catalog/brand/index.blade.php b/packages/Sarga/Brand/src/Resources/views/admin/catalog/brand/index.blade.php deleted file mode 100644 index 174926f..0000000 --- a/packages/Sarga/Brand/src/Resources/views/admin/catalog/brand/index.blade.php +++ /dev/null @@ -1,25 +0,0 @@ -@extends('admin::layouts.content') -@section('page_title') - {{ __('brand::app.brands') }} -@stop - -@section('content') -
- -
- - {!! app('Sarga\Brand\DataGrids\BrandDataGrid')->render() !!} - -
-
-@stop \ No newline at end of file diff --git a/packages/Sarga/Brand/src/Resources/views/admin/catalog/products/fields/brand.blade.php b/packages/Sarga/Brand/src/Resources/views/admin/catalog/products/fields/brand.blade.php deleted file mode 100644 index 295508a..0000000 --- a/packages/Sarga/Brand/src/Resources/views/admin/catalog/products/fields/brand.blade.php +++ /dev/null @@ -1,15 +0,0 @@ -@php $brands = app(Sarga\Brand\Repositories\BrandRepository::class)->actives(); @endphp -
- - - - @{{ errors.first('brand_id') }} -
\ No newline at end of file diff --git a/packages/Sarga/Brand/src/Routes/admin-routes.php b/packages/Sarga/Brand/src/Routes/admin-routes.php deleted file mode 100644 index bf55aff..0000000 --- a/packages/Sarga/Brand/src/Routes/admin-routes.php +++ /dev/null @@ -1,44 +0,0 @@ - ['web', 'admin', 'admin_locale'], 'prefix' => config('app.admin_url')], function () { - Route::prefix('catalog')->group(function () { - /** - * Categories routes. - */ - Route::get('/brands', [BrandController::class, 'index'])->defaults('_config', [ - 'view' => 'brand::admin.catalog.brand.index', - ])->name('admin.catalog.brand.index'); - - Route::get('/brands/create', [BrandController::class, 'create'])->defaults('_config', [ - 'view' => 'brand::admin.catalog.brand.create', - ])->name('admin.catalog.brand.create'); - - Route::post('/brands/create', [BrandController::class, 'store'])->defaults('_config', [ - 'redirect' => 'admin.catalog.brand.index', - ])->name('admin.catalog.brand.store'); - - Route::get('/brands/edit/{id}', [BrandController::class, 'edit'])->defaults('_config', [ - 'view' => 'brand::admin.catalog.brand.edit', - ])->name('admin.catalog.brand.edit'); - - Route::post('/brands/edit/{id}', [BrandController::class, 'update'])->defaults('_config', [ - 'redirect' => 'admin.catalog.brand.index', - ])->name('admin.catalog.brand.update'); - - Route::post('/brands/delete/{id}', [BrandController::class, 'destroy']) - ->name('admin.catalog.brand.delete'); - - Route::post('brands/massdelete', [BrandController::class, 'massDestroy'])->defaults('_config', [ - 'redirect' => 'admin.catalog.brand.index', - ])->name('admin.catalog.brand.massdelete'); - - Route::post('/brands/product/count', [BrandController::class, 'productCount']) - ->name('admin.catalog.brand.product.count'); - }); -}); - diff --git a/packages/Sarga/Brand/src/Routes/brand-routes.php b/packages/Sarga/Brand/src/Routes/brand-routes.php deleted file mode 100644 index 8c1dd00..0000000 --- a/packages/Sarga/Brand/src/Routes/brand-routes.php +++ /dev/null @@ -1,9 +0,0 @@ -attributeGroupRepo = $attributeGroupRepo; @@ -49,8 +49,8 @@ class ProductRepository extends WProductRepository $this->productFlatRepository = $productFlatRepository; $this->imageRepository = $productImageRepository; $this->vendorProductRepository = $vendorProductRepository; - $this->brandRepository = $brandRepository; - $this->vendorRepository = $vendorRepository; + // $this->brandRepository = $brandRepository; + // $this->vendorRepository = $vendorRepository; parent::__construct($attributeRepository, $app); } @@ -294,9 +294,9 @@ class ProductRepository extends WProductRepository } else $product['attribute_family_id'] = $product['type'] == 'configurable' ? 2 : 1; - if(!empty($data['brand']) && $brand = $this->brandRepository->findOneByField('name' , $data['brand'])){ - $product['brand_id'] = $brand->id; - } + // if(!empty($data['brand']) && $brand = $this->brandRepository->findOneByField('name' , $data['brand'])){ + // $product['brand_id'] = $brand->id; + // } //create product $parentProduct = $this->getModel()->create($product); $this->assignAttributes($parentProduct, [ diff --git a/packages/Webkul/Marketplace/src/Config/acl.php b/packages/Webkul/Marketplace/src/Config/acl.php index 2942c0b..8fa2d0a 100644 --- a/packages/Webkul/Marketplace/src/Config/acl.php +++ b/packages/Webkul/Marketplace/src/Config/acl.php @@ -1,25 +1,25 @@ 'marketplace', - 'name' => 'marketplace::app.admin.acl.marketplace', - 'route' => 'admin.marketplace.sellers.index', - 'sort' => 2 - ], [ - 'key' => 'marketplace.sellers', - 'name' => 'marketplace::app.admin.acl.sellers', - 'route' => 'admin.marketplace.sellers.index', - 'sort' => 1 - ], [ - 'key' => 'marketplace.products', - 'name' => 'marketplace::app.admin.acl.products', - 'route' => 'admin.marketplace.products.index', - 'sort' => 2 - ], [ - 'key' => 'marketplace.reviews', - 'name' => 'marketplace::app.admin.acl.reviews', - 'route' => 'admin.marketplace.reviews.index', - 'sort' => 3 - ] + // [ + // 'key' => 'marketplace', + // 'name' => 'marketplace::app.admin.acl.marketplace', + // 'route' => 'admin.marketplace.sellers.index', + // 'sort' => 2 + // ], [ + // 'key' => 'marketplace.sellers', + // 'name' => 'marketplace::app.admin.acl.sellers', + // 'route' => 'admin.marketplace.sellers.index', + // 'sort' => 1 + // ], [ + // 'key' => 'marketplace.products', + // 'name' => 'marketplace::app.admin.acl.products', + // 'route' => 'admin.marketplace.products.index', + // 'sort' => 2 + // ], [ + // 'key' => 'marketplace.reviews', + // 'name' => 'marketplace::app.admin.acl.reviews', + // 'route' => 'admin.marketplace.reviews.index', + // 'sort' => 3 + // ] ]; \ No newline at end of file