| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647 |
- <?php
- /**
- * 视频分类详情返回封装.
- *
- * @author nj
- * @date 2021-01-23 17:36:29
- */
- namespace Modules\ManageApi\Responses;
- use Illuminate\Contracts\Support\Responsable;
- class VideoCategoryDetailResponse implements Responsable
- {
- /**
- * 录入的数据.
- *
- * @var mixed
- */
- private $data = null;
- /**
- * 附加条件参数.
- *
- * @var array
- */
- private $params = [];
- public function __construct($data = null, $params = [])
- {
- $this->data = $data;
- $this->params = $params;
- }
- public function toResponse(
- $request = null
- ) {
- if (empty($this->data)) {
- return json_fail(trans('common.err_resource_not_found'));
- }
- $result = $this->data->toArray();
- unset($result['id']);
- return json_success($result);
- }
- }
|