See how a minor change to your commit message style can make a difference.
git commit -m"<type>(<optional scope>): <description>" \ -m"<optional body>" \ -m"<optional footer>"
| <?php | |
| $host = 'localhost'; | |
| $user = 'root'; | |
| $password = '123456'; | |
| $dbname = 'pdoposts'; | |
| // Set DSN | |
| $dsn = 'mysql:host='. $host .';dbname='. $dbname; | |
| // Create a PDO instance |
See how a minor change to your commit message style can make a difference.
git commit -m"<type>(<optional scope>): <description>" \ -m"<optional body>" \ -m"<optional footer>"
| <?php | |
| namespace App\Http\Middleware; | |
| use App\Exceptions\UnauthorizedException; | |
| use App\Http\Controllers\UsersController; | |
| use Closure; | |
| class Permission | |
| { |
| <?php | |
| $host = 'localhost'; | |
| $user = 'root'; | |
| $password = '123456'; | |
| $dbname = 'pdoposts'; | |
| // Set DSN | |
| $dsn = 'mysql:host='. $host .';dbname='. $dbname; | |
| // Create a PDO instance |
| <?php | |
| use Carbon\Carbon; | |
| use Illuminate\Database\Seeder; | |
| class CountrySeeder extends Seeder | |
| { | |
| public function addCountries(array $countries) | |
| { |
| <?php | |
| /* This gist is offered as is, make sure to test in your environment | |
| * | |
| * This class can be used to iterate over a large Eloquent query. It uses a combination of the PDO Fetch and | |
| * the chunk methods to collect a series of items in memory. The chunk part was necessary in order to implement | |
| * eager loading options. You can set the CHUNK_SIZE in the code to set how many rows to load in memory at a time | |
| * again for the eager loading purposes. | |
| * | |
| * I am sure there are other ways to implement this technique more effectively |
The simplest way to traverse the hierarchy tree with Baum is by iterating through the children relation.
<?php
$root = Category::roots()->with('children')->first();
echo "<h3>{$root->name}</h3>";
foreach($root->children as $category) {