laravel-learn-bbs/app/Http/Controllers/Api/CategoriesController.php

15 lines
290 B
PHP
Raw Permalink Normal View History

2018-06-10 10:04:03 +00:00
<?php
namespace App\Http\Controllers\Api;
use App\Models\Category;
use App\Transformers\CategoryTransformer;
class CategoriesController extends Controller
{
public function index()
{
return $this->response->collection(Category::all(), new CategoryTransformer());
}
}