quickclack / database-filler
This package for creating and running fillers on laravel projects
1.0.0
2023-06-03 11:07 UTC
Requires
- php: ^8.0.2|^8.1
This package is auto-updated.
Last update: 2025-01-03 14:52:18 UTC
README
This package will help you update database data using php classes
Installation
composer require quickclack/database-filler:dev-master
Usage
- php artisan migrate
- create directory fillers in ./database
- php artisan make:filler UpdateProductPriceFiller
<?php
declare(strict_types = 1);
use Illuminate\Support\Facades\DB;
return new class
{
public function run(): void
{
DB::table('prices')
->where('product_id', '=', 1)
->update([
'price' => 18.99
]);
}
};
- php artisan db:fill
License
The MIT License (MIT). Please see License File for more information.