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

24 lines
394 B
PHP
Raw Normal View History

2018-06-11 15:10:59 +00:00
<?php
/**
* Created by PhpStorm.
* User: xing
* Date: 2018/6/11
* Time: 22:40
*/
namespace App\Transformers;
use League\Fractal\TransformerAbstract;
use Spatie\Permission\Models\Role;
class RoleTransformer extends TransformerAbstract
{
public function transform(Role $role)
{
return [
'id' => $role->id,
'name' => $role->name,
];
}
}