ok
Direktori : /home2/selectio/public_html/3-idiots/app/Http/Controllers/api/v1/ |
Current File : /home2/selectio/public_html/3-idiots/app/Http/Controllers/api/v1/CategoryController.php |
<?php namespace App\Http\Controllers\api\v1; use App\CPU\CategoryManager; use App\CPU\Helpers; use App\Http\Controllers\Controller; use App\Model\Category; class CategoryController extends Controller { public function get_categories() { try { $categories = Category::with(['childes.childes'])->where(['position' => 0])->priority()->get(); return response()->json($categories, 200); } catch (\Exception $e) { return response()->json([], 200); } } public function get_products($id) { return response()->json(Helpers::product_data_formatting(CategoryManager::products($id), true), 200); } }