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

16 lines
314 B
PHP

<?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());
}
}