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 | |
| // This is what you might have right now | |
| Route::get('users/{id}', 'UserController@getProfile')->where('id', '[\d+]+'); | |
| Route::get('products/{id}', 'ProductController@getProfile')->where('id', '[\d+]+'); | |
| Route::get('articles/{slug}', 'ArticleController@getFull')->where('slug', '[a-z0-9-]+'); | |
| Route::get('faq/{slug}', 'FaqController@getQuestion')->where('slug', '[a-z0-9-]+'); | |
| // and many more, now imagine you'll have to change the rule | |
| // Instead, you can simplify and reuse them everywhere: | |
| // Patterns |
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
| <!-- Add the following lines to theme's html code right before </head> --> | |
| <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.0/jquery.min.js"></script> | |
| <script src="http://static.tumblr.com/fpifyru/VCxlv9xwi/writecapture.js"></script> | |
| <script src="http://static.tumblr.com/fpifyru/AKFlv9zdu/embedgist.js"></script> | |
| <!-- | |
| Usage: just add <div class="gist">[gist URL]</div> | |
| Example: <div class="gist">https://gist.github.com/1395926</div> | |
| --> |