PHP code example of dragon-code / laravel-deploy-operations
1. Go to this page and download the library: Download dragon-code/laravel-deploy-operations 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/ */
dragon-code / laravel-deploy-operations example snippets
use App\Models\Article;
use DragonCode\LaravelDeployOperations\Operation;
return new class extends Operation {
public function __invoke(): void
{
Article::query()
->lazyById(chunkSize: 100, column: 'id')
->each->update(['is_active' => true]);
// and/or any actions...
}
};
Bash
php artisan operations