laravel/framework — pull request #5859 by HipsterJazzbo (2014-09-27 05:02:30+00:00)
Title: [Proposal] Add setter for route name

This enables us instead of doing this:

```php
$router->get('/', ['uses' => 'Controller@method', 'as' => 'route.name']);
```

to do this:

```php
$router->get('/', 'Controller@method')->name('route.name');
```

Which is a lot nicer.

I also would like to propose that the Router be refactored to remove the array syntax for the second parameter altogether, and replace it with chainable methods. This seems like a much better approach for many reasons, including:

- It's more OOP-like
- It's self-documenting
- It's more IDE-friendly
- It's less error-prone
- It's prettier
- It'll do your dishes

I've started doing this just to see if it can be done, and I think it wouldn't be that big of a deal, but I don't want to put all the time into it if it'll get dismissed as either impossible or unwanted.

Thanks for reading! :beers: