Files
htt-locator/database/seeders/ArticoloSeeder.php

28 lines
514 B
PHP

<?php
namespace Database\Seeders;
use App\Models\Articolo;
use Illuminate\Database\Seeder;
use PhpOffice\PhpSpreadsheet\IOFactory;
class ArticoloSeeder extends Seeder
{
/**
* Run the database seeds.
*/
public function run(): void
{
$filePath = base_path('STRUTTURA DATABASE.xlsx');
if (!file_exists($filePath)) {
$this->command->error('File Excel non trovato: ' . $filePath);
return;
}
$this->importFromExcel($filePath);
}
}