2021-10-27 16:06:17 +00:00
|
|
|
<?php
|
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-10-28 15:30:35 +00:00
|
|
|
use Sarga\API\Http\Controllers\Resources;
|
|
|
|
|
use Webkul\Attribute\Repositories\AttributeRepository;
|
|
|
|
|
use Sarga\API\Http\Resources\Catalog\Attribute;
|
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
|
|
|
|
|
|
|
|
//category routes
|
|
|
|
|
Route::get('descendant-categories', [Categories::class, 'index']);
|
|
|
|
|
Route::get('category-brands/{id}', [Categories::class, 'brands']);
|
|
|
|
|
|
2021-10-28 15:30:35 +00:00
|
|
|
//attributes by code
|
|
|
|
|
Route::get('attribute-by-code/{code}', [Resources::class, 'get'])->defaults('_config', [
|
|
|
|
|
'repository' => AttributeRepository::class,
|
|
|
|
|
'resource' => Attribute::class,
|
|
|
|
|
]);
|
|
|
|
|
|
2021-10-27 16:06:17 +00:00
|
|
|
});
|
|
|
|
|
});
|