I'm still very new at Laravel.
I got problem how can I use Isset($_GET)
?
How to get for example: http://virtualhost.com/flytrap/public/location?city=25?
Usually when at pure PHP, I always use:
if (isset($_GET["submit"]))
{
$location = $_GET["city"];
}
to get city value. So I can use it for query at database. If I use Core PHP method I got an error.
You can use below code
$location = Request::query('city', false); //insed of $_GET['city'];
This is Laravel equivalent (see http://laravel.com/docs/4.2/requests):
if (Input::has('submit')) {
$location = Input::get('city');
}
But as Lalit Sharma says, you should maybe always set $location even if you have not "submit" in GET:
$location = Input::get('city', null);
null is the default value so you can ommit it or use any other value:
$location = Input::get('city', 'Reykjavik');