39 lines
1.1 KiB
PHP
39 lines
1.1 KiB
PHP
<?php
|
|
|
|
namespace Database\Seeders;
|
|
|
|
use Illuminate\Database\Console\Seeds\WithoutModelEvents;
|
|
use Illuminate\Database\Seeder;
|
|
use App\Models\Color;
|
|
|
|
class ColorSeeder extends Seeder
|
|
{
|
|
/**
|
|
* Run the database seeds.
|
|
*/
|
|
public function run(): void
|
|
{
|
|
// Seed predefined Colors
|
|
$colors = [
|
|
['name' => 'Red', 'hex' => '#FF0000'],
|
|
['name' => 'Green', 'hex' => '#00FF00'],
|
|
['name' => 'Blue', 'hex' => '#0000FF'],
|
|
['name' => 'Yellow', 'hex' => '#FFFF00'],
|
|
['name' => 'Orange', 'hex' => '#FFA500'],
|
|
['name' => 'Purple', 'hex' => '#800080'],
|
|
['name' => 'Pink', 'hex' => '#FFC0CB'],
|
|
['name' => 'Brown', 'hex' => '#A52A2A'],
|
|
['name' => 'Gray', 'hex' => '#808080'],
|
|
['name' => 'Black', 'hex' => '#000000'],
|
|
['name' => 'White', 'hex' => '#FFFFFF'],
|
|
['name' => 'Gold', 'hex' => '#FFD700'],
|
|
['name' => 'Silver', 'hex' => '#C0C0C0'],
|
|
['name' => 'Cyan', 'hex' => '#00FFFF']
|
|
];
|
|
|
|
foreach ($colors as $color) {
|
|
Color::create($color);
|
|
}
|
|
}
|
|
}
|