Last active
August 5, 2016 02:06
-
-
Save jarektkaczyk/8d3e1f34e6e6c6970173 to your computer and use it in GitHub Desktop.
Laravel5 helpers for tinkering with your app
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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