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
| # Shutdown the laravel app | |
| php artisan down | |
| # Install new composer packages | |
| composer install --no-dev --prefer-dist | |
| # Cache boost configuration and routes | |
| php artisan cache:clear | |
| php artisan config:cache | |
| php artisan route:cache |
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 | |
| /** | |
| * usage in a controlller: | |
| * public function index($page=1) { | |
| * $users = User::paginateUri(5, $page, $links); | |
| * return view('users', compact('users','links')); | |
| * } | |
| * it also support variable number of parameters, | |
| * routes must be defined using {page} or {page?} placeholders |
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
| /******************************************************************************* | |
| * Merges matching documents from source collection into desination collection | |
| * Usage: | |
| * mergeCollections("srcCollName", "destCollName", null, ["f1","f3"]) | |
| * mergeCollections("srcCollName", "destCollName", {xy:"z"}, ["f1","f4"]) | |
| ********************************************************************************/ | |
| function mergeCollections(sourceCollection, destCollection, sourceQuery, setFields) { | |
| var nMatched = 0; | |
| var nModified = 0; | |
| sourceQuery = sourceQuery || {} |