laravel-learn-bbs/app/Transformers/LinkTransformer.php

25 lines
415 B
PHP
Raw Permalink Normal View History

2018-06-16 01:15:01 +00:00
<?php
/**
* Created by PhpStorm.
* User: xing
* Date: 2018/6/16
* Time: 8:25
*/
namespace App\Transformers;
use App\Models\Link;
use League\Fractal\TransformerAbstract;
class LinkTransformer extends TransformerAbstract
{
public function transform(Link $link)
{
return [
'id' => $link->id,
'title' => $link->title,
'link' => $link->link
];
}
}