Laravel Fractal Transform - 从变换器返回布尔值

时间:2016-12-14 09:47:36

标签: php laravel laravel-5.3

如果记录存在,是否可以返回布尔值?

public function includeIsFavorite( Model $model ){
        $is_favorite =  $this->item( $model->favorite, new FavoriteTransformer() );
        //if $is_favorite is not empty 
        //then return true here...
}

有什么想法吗?

0 个答案:

没有答案