PHP code example of simone-bianco / laravel-patches
1. Go to this page and download the library: Download simone-bianco/laravel-patches 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/ */
use SimoneBianco\Patches\Patch;
return new class extends Patch
{
public bool $transactional = true;
public function up(): void
{
// Apply data changes.
}
public function down(): void
{
// Reverse data changes.
}
};
use App\Models\Setting;
use SimoneBianco\Patches\Patch;
return new class extends Patch
{
public bool $transactional = true;
public function up(): void
{
foreach ( Setting::query()
->whereIn('key', array_column(