Created
August 19, 2014 14:40
-
-
Save ameliaikeda/811e6e7a67384841184c to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| Route::bind("user", function ($user) { | |
| return User::findOrFail(["name" => $user]); | |
| }); | |
| App::bind("User", "UserRepository"); | |
| Route::resource("/users/{user}", "UserController"); | |
| // in the controller: | |
| class UserController extends Controller { | |
| public fucntion __contruct(UserRepository $user) { | |
| $this->user = $user; | |
| } | |
| public function store() {} | |
| public function get() {} | |
| public function update() {} | |
| public function delete() {} | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment