Add Filament admin panel and creative public portfolio site
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>
This commit is contained in:
@@ -0,0 +1,53 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Controllers;
|
||||
|
||||
use App\Models\Education;
|
||||
use App\Models\Experience;
|
||||
use App\Models\Post;
|
||||
use App\Models\Profile;
|
||||
use App\Models\Project;
|
||||
use Illuminate\View\View;
|
||||
|
||||
class HomeController extends Controller
|
||||
{
|
||||
public function index(): View
|
||||
{
|
||||
$profile = Profile::query()->first();
|
||||
|
||||
$timeline = Experience::query()->get()->map(fn (Experience $item) => (object) [
|
||||
'type' => 'work',
|
||||
'title' => $item->role,
|
||||
'subtitle' => $item->company,
|
||||
'start_date' => $item->start_date,
|
||||
'end_date' => $item->end_date,
|
||||
'is_current' => $item->is_current,
|
||||
'description' => $item->description,
|
||||
])->concat(Education::query()->get()->map(fn (Education $item) => (object) [
|
||||
'type' => 'education',
|
||||
'title' => $item->degree
|
||||
? $item->degree . ($item->field_of_study ? " in {$item->field_of_study}" : '')
|
||||
: $item->institution,
|
||||
'subtitle' => $item->institution,
|
||||
'start_date' => $item->start_date,
|
||||
'end_date' => $item->end_date,
|
||||
'is_current' => false,
|
||||
'description' => $item->description,
|
||||
]))->sortByDesc(fn (object $item) => $item->start_date)->values();
|
||||
|
||||
$projects = Project::query()
|
||||
->orderByDesc('is_featured')
|
||||
->orderBy('sort_order')
|
||||
->orderByDesc('created_at')
|
||||
->limit(4)
|
||||
->get();
|
||||
|
||||
$posts = Post::query()
|
||||
->published()
|
||||
->orderByDesc('published_at')
|
||||
->limit(3)
|
||||
->get();
|
||||
|
||||
return view('home', compact('profile', 'timeline', 'projects', 'posts'));
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,26 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Controllers;
|
||||
|
||||
use App\Models\Post;
|
||||
use Illuminate\View\View;
|
||||
|
||||
class PostController extends Controller
|
||||
{
|
||||
public function index(): View
|
||||
{
|
||||
$posts = Post::query()
|
||||
->published()
|
||||
->orderByDesc('published_at')
|
||||
->paginate(6);
|
||||
|
||||
return view('posts.index', compact('posts'));
|
||||
}
|
||||
|
||||
public function show(Post $post): View
|
||||
{
|
||||
abort_unless($post->published_at?->isPast(), 404);
|
||||
|
||||
return view('posts.show', compact('post'));
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,25 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Controllers;
|
||||
|
||||
use App\Models\Project;
|
||||
use Illuminate\View\View;
|
||||
|
||||
class ProjectController extends Controller
|
||||
{
|
||||
public function index(): View
|
||||
{
|
||||
$projects = Project::query()
|
||||
->orderByDesc('is_featured')
|
||||
->orderBy('sort_order')
|
||||
->orderByDesc('created_at')
|
||||
->get();
|
||||
|
||||
return view('projects.index', compact('projects'));
|
||||
}
|
||||
|
||||
public function show(Project $project): View
|
||||
{
|
||||
return view('projects.show', compact('project'));
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user