protected function maybeMakeResource($type, $data, $status = 200) {
        $resourceName = $type . 'Resource';
        if(isset($this->$resourceName) && $this->$resourceName) {
            $class = $this->$resourceName;
            return (new $class($data))->response()
            ->setStatusCode($status);
        } elseif(is_bool($data)){
            return strval($data);
        } else {
            return $data;
        }
    }