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

16 lines
314 B
PHP
Raw Permalink Normal View History

2018-06-16 01:15:01 +00:00
<?php
namespace App\Http\Controllers\Api;
use App\Models\Link;
use App\Transformers\LinkTransformer;
class LinksController extends Controller
{
public function index(Link $link)
{
$links = $link->getAllCached();
return $this->response->collection($links, new LinkTransformer());
}
}