-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathseed.php
More file actions
51 lines (42 loc) · 1.6 KB
/
seed.php
File metadata and controls
51 lines (42 loc) · 1.6 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
<?php
require_once __DIR__ . '/bootstrap.php';
use App\Models\Todo;
use App\Models\Seo;
use App\Models\Setting;
// Sample tasks to seed
$tasks = [
['title' => '🚀 Initialize TaskFlow project', 'completed' => true],
['title' => '🐘 Setup Eloquent ORM with SQLite', 'completed' => true],
['title' => '⚛️ Build high-performance React frontend', 'completed' => false],
['title' => '🎨 Apply premium mesh-gradient styling', 'completed' => false],
['title' => '🌓 Implement robust theme toggle', 'completed' => true],
['title' => '📜 Update documentation & README', 'completed' => false],
];
echo "🌱 Seeding sample todos...\n";
foreach ($tasks as $task) {
echo "Creating task: {$task['title']}... ";
Todo::firstOrCreate(['title' => $task['title']], $task);
echo "✅\n";
}
echo "🌱 Seeding SEO settings...\n";
Setting::firstOrCreate(['key' => 'enable_dynamic_seo'], ['value' => '1']);
$seoItems = [
[
'path' => '/',
'title' => 'TaskFlow - Modern PHP & React Template',
'description' => 'A high-performance boilerplate for unified PHP and React development.',
'keywords' => 'php, react, template, eloquent, vite, tailwind',
],
[
'path' => '/about',
'title' => 'About TaskFlow',
'description' => 'Learn more about the TaskFlow unified architecture.',
'keywords' => 'about, taskflow, project',
]
];
foreach ($seoItems as $seo) {
echo "Creating SEO for: {$seo['path']}... ";
Seo::firstOrCreate(['path' => $seo['path']], $seo);
echo "✅\n";
}
echo "🎉 Database seeded successfully!\n";