Update dependencies and enhance components
- Added "halaxa/json-machine" dependency to composer.json. - Updated content hash in composer.lock to reflect changes. - Improved SpatieMediaLibraryFileEntry component documentation. - Expanded FillJsonData seeder to include new migrators for card types, orders, and pin orders. - Updated Tailwind CSS version in app.css. - Refactored various JavaScript components for better performance and readability. - Added a test route in web.php for debugging purpose
This commit is contained in:
32
database/seeders/Migrators/LoanOrdersMigrator.php
Normal file
32
database/seeders/Migrators/LoanOrdersMigrator.php
Normal file
@@ -0,0 +1,32 @@
|
||||
<?php
|
||||
|
||||
namespace Database\Seeders\Migrators;
|
||||
|
||||
use JsonMachine\JsonMachine;
|
||||
use JsonMachine\Items;
|
||||
use Illuminate\Support\Facades\DB;
|
||||
use Illuminate\Support\Facades\File;
|
||||
use Illuminate\Support\LazyCollection;
|
||||
use Cerbero\LazyJson\LazyJson;
|
||||
|
||||
class LoanOrdersMigrator
|
||||
{
|
||||
public function migrate(): void
|
||||
{
|
||||
// Running on seeder file, may not work.
|
||||
|
||||
DB::table('loan_orders')->truncate();
|
||||
|
||||
$path = database_path('data/nurmuhammetsdb/loan_orders.json');
|
||||
|
||||
$items = Items::fromFile($path);
|
||||
|
||||
foreach ($items as $id => $item) {
|
||||
if (! $item) {
|
||||
continue;
|
||||
}
|
||||
|
||||
DB::table('loan_orders')->insert((array) $item);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user