Adds a Filament admin (Profile settings page plus CRUD resources for Education, Experience, Projects, and Posts) backing a public-facing personal site: hero/about/timeline home page, project showcase, and blog, styled with a dark editorial theme (Fraunces + Instrument Sans). Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
99 lines
3.4 KiB
PHP
99 lines
3.4 KiB
PHP
<?php
|
|
|
|
namespace Database\Seeders;
|
|
|
|
use App\Models\Education;
|
|
use App\Models\Experience;
|
|
use App\Models\Post;
|
|
use App\Models\Profile;
|
|
use App\Models\Project;
|
|
use App\Models\User;
|
|
use Illuminate\Database\Console\Seeds\WithoutModelEvents;
|
|
use Illuminate\Database\Seeder;
|
|
|
|
class DatabaseSeeder extends Seeder
|
|
{
|
|
use WithoutModelEvents;
|
|
|
|
/**
|
|
* Seed the application's database.
|
|
*/
|
|
public function run(): void
|
|
{
|
|
User::firstOrCreate(
|
|
['email' => 'admin@mikeisdeving.test'],
|
|
['name' => 'Mike', 'password' => bcrypt('password')],
|
|
);
|
|
|
|
Profile::query()->firstOrCreate([], [
|
|
'name' => 'Mike',
|
|
'headline' => 'Backend developer & tinkerer',
|
|
'bio' => '<p>I build web apps and occasionally write about it. This is a placeholder bio — edit it from the admin panel.</p>',
|
|
'location' => 'Somewhere, Earth',
|
|
'email' => 'hello@mikeisdeving.test',
|
|
'social_links' => [
|
|
'github' => 'https://github.com/',
|
|
'linkedin' => 'https://linkedin.com/',
|
|
],
|
|
]);
|
|
|
|
if (Experience::query()->count() === 0) {
|
|
Experience::create([
|
|
'company' => 'Acme Corp',
|
|
'role' => 'Senior Developer',
|
|
'location' => 'Remote',
|
|
'start_date' => '2023-01-01',
|
|
'is_current' => true,
|
|
'description' => 'Working on backend systems and internal tooling.',
|
|
'sort_order' => 0,
|
|
]);
|
|
|
|
Experience::create([
|
|
'company' => 'Startup Inc',
|
|
'role' => 'Software Developer',
|
|
'location' => 'Remote',
|
|
'start_date' => '2020-06-01',
|
|
'end_date' => '2022-12-01',
|
|
'description' => 'Built and maintained a SaaS product from early stage to scale.',
|
|
'sort_order' => 1,
|
|
]);
|
|
}
|
|
|
|
if (Education::query()->count() === 0) {
|
|
Education::create([
|
|
'institution' => 'State University',
|
|
'degree' => 'B.Sc.',
|
|
'field_of_study' => 'Computer Science',
|
|
'start_date' => '2016-09-01',
|
|
'end_date' => '2020-06-01',
|
|
'sort_order' => 0,
|
|
]);
|
|
}
|
|
|
|
if (Project::query()->count() === 0) {
|
|
Project::create([
|
|
'title' => 'Sample Project',
|
|
'slug' => 'sample-project',
|
|
'summary' => 'A short description of what this project does.',
|
|
'description' => '<p>Longer write-up of the project, the problem it solves, and how it was built.</p>',
|
|
'url' => 'https://example.com',
|
|
'repository_url' => 'https://github.com/example/example',
|
|
'tech_stack' => ['Laravel', 'PHP', 'Tailwind'],
|
|
'is_featured' => true,
|
|
'sort_order' => 0,
|
|
]);
|
|
}
|
|
|
|
if (Post::query()->count() === 0) {
|
|
Post::create([
|
|
'title' => 'Hello, world',
|
|
'slug' => 'hello-world',
|
|
'excerpt' => 'The first post on this blog.',
|
|
'body' => '<p>This is a placeholder post. Edit or delete it from the admin panel.</p>',
|
|
'tags' => ['meta'],
|
|
'published_at' => now(),
|
|
]);
|
|
}
|
|
}
|
|
}
|