40 lines
976 B
PHP
40 lines
976 B
PHP
<?php
|
|
|
|
namespace Database\Seeders;
|
|
|
|
use App\Enums\Page;
|
|
use App\Lib\Utils;
|
|
use App\Models\Picto;
|
|
use Illuminate\Database\Seeder;
|
|
use SplFileInfo;
|
|
|
|
class PictosSeeder extends Seeder
|
|
{
|
|
/**
|
|
* Run the database seeds.
|
|
*
|
|
* @return void
|
|
*/
|
|
public function run()
|
|
{
|
|
$tabEncarts = [
|
|
Page::marqueBloc2(),
|
|
Page::foodBloc2()
|
|
];
|
|
|
|
$upload = new SplFileInfo(resource_path('assets/images/qualite.png'));
|
|
$picto = new Picto();
|
|
$imgpath = Utils::storeImage($upload, $picto->getTable());
|
|
|
|
foreach ($tabEncarts as $value) {
|
|
for ($i = 0; $i < 5; $i++) {
|
|
$picto = new Picto();
|
|
$picto->page = $value;
|
|
$picto->picture = $imgpath;
|
|
$picto->alt_text_picture = 'lorem ipsum set doloris at em gorbicus';
|
|
$picto->text = 'lorem ipsum set doloris';
|
|
$picto->save();
|
|
}
|
|
}
|
|
}
|
|
}
|