laravel/framework — pull request #5341 by dwightwatson (2014-08-05 11:45:48+00:00)
Title: Implement RouteableInterface to ease routing with Eloquent models

As originally discussed in #5253, here is a potential implementation of Eloquent routing. The model implements the `RouteableInterface` out of the box to use the model's primary key, but this can be overridden as needed.

If you attempt to build a URL using an Eloquent model, or any class that implements the `RouteableInterface`, it's route key will be used as the parameter in the path.

Furthermore, if you use route model binding, it will find the model by it's route key instead of it's primary key.