PHP code example of hopheartsceo / laravel-release-guard

1. Go to this page and download the library: Download hopheartsceo/laravel-release-guard library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

hopheartsceo / laravel-release-guard example snippets


Schema::table('users', function (Blueprint $table) {
    $table->dropColumn('phone');
});

User::query()
    ->where('phone', $phone)
    ->first();

return [
    'paths' => [
        'application' => [
            'app',
        ],

        'migrations' => [
            'database/migrations',
        ],
    ],

    'confidence' => [
        'fail_on' => 'definite',
    ],

    'rules' => [
        'DB001' => true,
        'DB002' => true,
        'DB003' => true,
        'DB004' => true,
        'DB005' => true,
        'DB006' => true,
    ],
];

User::create([
    'name' => $name,
    'email' => $email,
]);

$user = new User([
    'name' => $name,
    'email' => $email,
]);

$user->save();
bash
php artisan release-guard:check --against=origin/main
bash
php artisan release-guard:check --against=HEAD~1
php artisan release-guard:check --against=v1.2.3
php artisan release-guard:check --against=origin/master
bash
php artisan release-guard:check \
    --against=origin/main \
    --format=json
text
[BLOCKER][DEFINITE][DB001] users.phone — app/Services/UserLookup.php:27
bash
php artisan release-guard:check \
    --against=origin/main \
    --format=json
bash
php artisan vendor:publish \
    --tag=release-guard-config