25 lines
566 B
PHP
25 lines
566 B
PHP
<?php
|
|
|
|
namespace Database\Seeders;
|
|
|
|
use App\Lib\Helpers\FileStorageHelper;
|
|
use App\Models\Brand;
|
|
use Illuminate\Database\Seeder;
|
|
|
|
class BrandSeeder extends Seeder
|
|
{
|
|
/**
|
|
* Run the database seeds.
|
|
*
|
|
* @return void
|
|
*/
|
|
public function run()
|
|
{
|
|
Brand::factory(50)->make()->each(function (Brand $brand) {
|
|
$brand->logo = FileStorageHelper::storeFile($brand, new \SplFileInfo(\resource_path(
|
|
'../resources/assets/images/brand/logo.jpg'
|
|
)));
|
|
$brand->saveOrFail();
|
|
});
|
|
}
|
|
}
|