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

17 lines
363 B
PHP
Raw Normal View History

2022-11-29 10:54:43 +00:00
<?php
namespace App\Http\Controllers\Api;
use App\Models\Document;
use App\Transformers\DocumentTransformer;
class DocumentController extends ApiController
{
public function index()
{
$documents = Document::orderBy('lft', 'desc')->get();
return $this->respondWithCollection($documents, new DocumentTransformer($this->locale));
}
}