Skip to content

Instantly share code, notes, and snippets.

@jarektkaczyk
Last active August 5, 2016 02:06
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jarektkaczyk/8d3e1f34e6e6c6970173 to your computer and use it in GitHub Desktop.
Save jarektkaczyk/8d3e1f34e6e6c6970173 to your computer and use it in GitHub Desktop.
Laravel5 helpers for tinkering with your app
<?php
/**
* Print query with bindings instead of '?'
*/
function toRaw($query)
{
return vsprintf(str_replace('?', "'%s'", $query->toSql()), $query->getBindings());
}
if ( ! function_exists('request'))
{
/**
* Call the given URI and return the Response.
*
* @param string $method
* @param string $uri
* @param array $parameters
* @param array $cookies
* @param array $files
* @param array $server
* @param string $content
* @return \Illuminate\Http\Response
*/
function request($method, $uri, $parameters = [], $cookies = [], $files = [], $server = [], $content = null)
{
$request = \Illuminate\Http\Request::create($uri, $method, $parameters, $cookies, $files, $server, $content);
return \App::make('Illuminate\Contracts\Http\Kernel')->handle($request);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment