exchange/app/Http/Controllers/Api/DocumentCategoryController.php

16 lines
399 B
PHP
Raw Normal View History

2022-12-20 07:50:01 +00:00
<?php
namespace App\Http\Controllers\Api;
use App\Models\DocumentCategory;
use App\Transformers\CategoryTransformer;
class DocumentCategoryController extends ApiController
{
public function index()
{
$categories = DocumentCategory::orderBy('lft', 'desc')->get();
return $this->respondWithCollection($categories, new CategoryTransformer($this->locale, 'trading'));
}
}