标签: 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... }
有什么想法吗?