public function prepare($options = [])
    {
        if (request()->ajax()) {
            return $this->getArray($options);
        }

        return $this->getHtml($options);
    }
public function prepare($options = [])
    {
        if (request()->ajax()) {
            return $this->getArray($options);
        }

        return $this->getHtml($options);
    }
public function prepare ( $ options = [ ] ) { if ( request ( ) -> ajax ( ) ) { return $ this -> getArray ( $ options ) ; } return $ this -> getHtml ( $ options ) ; }
Automatically returns the object based on the http request.

@return html|array
Automatically returns the object based on the http request .