sarga/packages/Sarga/API/Http/routes.php

60 lines
2.4 KiB
PHP
Raw Normal View History

2021-10-27 16:06:17 +00:00
<?php
2021-10-27 17:13:21 +00:00
use Illuminate\Support\Facades\Route;
2022-01-24 12:20:46 +00:00
use Sarga\API\Http\Controllers\Customers;
2021-10-27 17:13:21 +00:00
use Sarga\API\Http\Controllers\Categories;
2021-10-27 16:06:17 +00:00
use Sarga\API\Http\Controllers\Channels;
2021-12-10 14:30:26 +00:00
use Sarga\API\Http\Controllers\IntegrationController;
use Sarga\API\Http\Controllers\Vendors;
2021-11-09 17:55:21 +00:00
use Sarga\API\Http\Controllers\Products;
2021-12-30 04:31:36 +00:00
use Sarga\Shop\Repositories\CategoryRepository;
2021-10-28 16:36:04 +00:00
use Webkul\API\Http\Controllers\Shop\ResourceController;
use Webkul\Attribute\Repositories\AttributeOptionRepository;
use Sarga\API\Http\Resources\Catalog\AttributeOption;
2021-12-30 04:31:36 +00:00
use Sarga\API\Http\Resources\Catalog\Category;
2021-10-27 16:06:17 +00:00
Route::group(['prefix' => 'api'], function ($router) {
Route::group(['middleware' => ['locale', 'currency']], function ($router) {
//Channel routes
Route::get('channels',[Channels::class, 'index']);
2021-10-27 17:13:21 +00:00
//Vendors
2022-01-19 14:04:47 +00:00
Route::get('vendors',[Vendors::class,'index'])->name('api.vendors');
Route::get('vendor/products/{vendor_id}',[Vendors::class,'vendor_products'])->name('api.vendor.products');
2021-10-27 17:13:21 +00:00
//category routes
2021-12-30 04:31:36 +00:00
Route::get('descendant-categories', [Categories::class, 'index'])->name('api.descendant-categories');
2021-10-27 17:13:21 +00:00
Route::get('category-brands/{id}', [Categories::class, 'brands']);
2021-12-30 04:31:36 +00:00
Route::get('categories', [ResourceController::class, 'index'])->defaults('_config', [
'repository' => CategoryRepository::class,
'resource' => Category::class,
])->name('api.categories');
2021-10-28 15:30:35 +00:00
//attributes by code
2021-10-28 16:36:04 +00:00
Route::get('attribute-options', [ResourceController::class, 'index'])->defaults('_config', [
'repository' => AttributeOptionRepository::class,
'resource' => AttributeOption::class,
2021-10-28 15:30:35 +00:00
]);
2021-11-09 17:55:21 +00:00
//Product routes
Route::get('products', [Products::class, 'index']);
Route::get('products/{id}', [Products::class, 'get']);
2022-01-21 10:22:27 +00:00
Route::get('products/{id}/variants', [Products::class, 'variants']);
2021-10-27 16:06:17 +00:00
});
2021-12-06 11:52:58 +00:00
Route::group(['prefix' => 'scrap','middleware' =>['scrap']], function ($router){
2021-12-10 14:30:26 +00:00
Route::put('upload',[IntegrationController::class,'bulk_upload']);
2021-12-18 20:20:59 +00:00
Route::put('create',[IntegrationController::class,'create']);
2021-12-06 11:52:58 +00:00
});
2022-01-24 12:20:46 +00:00
2022-01-25 07:25:49 +00:00
Route::group(['prefix' => 'customer'],function ($router){
Route::post('register', [Customers::class, 'register']);
Route::post('login', [Customers::class, 'login']);
2022-01-26 07:06:18 +00:00
Route::put('profile', [Customers::class, 'store']);
2022-01-25 07:25:49 +00:00
});
2021-10-27 16:06:17 +00:00
});