Skip to content

Instantly share code, notes, and snippets.

@jabdul
Last active August 29, 2015 14:22
Show Gist options
  • Save jabdul/e635a3b37372f0fbdc53 to your computer and use it in GitHub Desktop.
Save jabdul/e635a3b37372f0fbdc53 to your computer and use it in GitHub Desktop.
Stored procedure call in Laravel 5.0
if (isset($uri)) {
$result = DB::statement('CALL get_address_id(?, @address_id)',
array($uri)
);
$address_id = DB::select('SELECT @address_id');
$address_data = DB::select('CALL get_address(?)',
array($address_id[0]->{'@address_id'})
);
return $this->createJSONResponse(array(get_object_vars($address_data[0])), $uri, null);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment