In Git you can add a submodule to a repository. This is basically a sub-repository embedded in your main repository. This can be very useful. A couple of usecases of submodules:
- Separate big codebases into multiple repositories.
| #### Issue description | |
| #### Steps to reproduce the issue | |
| 1. | |
| 2. | |
| 3. |
| <!-- Example on how to set class="active" on active navigation links --> | |
| <!-- These links will always be visible --> | |
| <li class="{{ URI::is( 'home') ? 'active' : '' }}"> | |
| <a href="{{ URL::to( 'home') }}"> | |
| Home | |
| </a> | |
| </li> | |
| <li class="{{ URI::is( 'gallery') ? 'active' : '' }}"> |
Dumping ground for Links
#Laravel 5 Simple ACL manager
Protect your routes with user roles. Simply add a 'role_id' to the User model, install the roles table and seed if you need some example roles to get going.
If the user has a 'Root' role, then they can perform any actions.
Simply copy the files across into the appropriate directories, and register the middleware in App\Http\Kernel.php
| #Get the size of each table, ordered by largest to smallest | |
| SELECT table_name AS "Tables", | |
| round(((data_length + index_length) / 1024 / 1024), 2) "Size in MB" | |
| FROM information_schema.TABLES | |
| WHERE table_schema = "YOU+TABLE+NAME+HERE" | |
| ORDER BY (data_length + index_length) DESC; | |
| #Get the size of the entire DB | |
| SELECT table_schema "DB Name", | |
| Round(Sum(data_length + index_length) / 1024 / 1024, 1) "DB Size in MB" |
| <?php | |
| namespace App\Database\Schema; | |
| use Illuminate\Database\Schema\Blueprint as ParentBlueprint; | |
| use Illuminate\Support\Facades\DB; | |
| /** | |
| * Class Blueprint | |
| * |
| /** | |
| * Create a Symfony response for the given exception. | |
| * | |
| * @param \Exception $e | |
| * @return mixed | |
| */ | |
| protected function convertExceptionToResponse(Exception $e) | |
| { | |
| if (config('app.debug')) { | |
| $whoops = new \Whoops\Run; |
| # ref: https://twitter.com/gonedark/status/1174460639005356032 | |
| # usage: fixup [ref] | |
| function fixup() { | |
| git commit --fixup="$1" | |
| GIT_SEQUENCE_EDITOR=: git rebase -i --autosquash "$1"~1 | |
| } | |
| # credit: https://stackoverflow.com/questions/29094595/git-interactive-rebase-without-opening-the-editor |