# Routing

You will find the routes at `config/routes/web.php`. Then this is how you declare a basic route.

```php
Route::get('/uri', ['Controller@method', ['middleware']]);
```

**/uri** - the route you want to define.

**\['Controller\@method', \['middleware']]** - the action of the `/uri`

**middleware** - handles the protection of our routes basically our guardians.

**Middleware Present:**

* **auth** : is the route guardian to protect your routes from direct access in the URL without authentication. If not specified the route will be accessible without authentication.

Sprnva routing supports this following methods:

```php
Route::get($uri, $action);
Route::post($uri, $action);
Route::put($uri, $action);
Route::patch($uri, $action);
Route::delete($uri, $action);
Route::options($uri, $action);
```

This is what a basic route look like:

```php
// routes is accessible without authenticating
Route::get("/register", ['RegisterController@index']);
Route::post("/register", ['RegisterController@store']);

// routes is accessible only if authenticated
Route::get("/profile", ['ProfileController@index', ['auth']]);
Route::post('/profile', ['ProfileController@update', ['auth']]);
```

where profile route is protected by middleware auth. It means you cannot access this route directly in the URL without authenticating.
