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,48 @@
|
||||
<?php
|
||||
|
||||
namespace App\Filament\Resources\Education;
|
||||
|
||||
use App\Filament\Resources\Education\Pages\CreateEducation;
|
||||
use App\Filament\Resources\Education\Pages\EditEducation;
|
||||
use App\Filament\Resources\Education\Pages\ListEducation;
|
||||
use App\Filament\Resources\Education\Schemas\EducationForm;
|
||||
use App\Filament\Resources\Education\Tables\EducationTable;
|
||||
use App\Models\Education;
|
||||
use BackedEnum;
|
||||
use Filament\Resources\Resource;
|
||||
use Filament\Schemas\Schema;
|
||||
use Filament\Support\Icons\Heroicon;
|
||||
use Filament\Tables\Table;
|
||||
|
||||
class EducationResource extends Resource
|
||||
{
|
||||
protected static ?string $model = Education::class;
|
||||
|
||||
protected static string|BackedEnum|null $navigationIcon = Heroicon::OutlinedRectangleStack;
|
||||
|
||||
public static function form(Schema $schema): Schema
|
||||
{
|
||||
return EducationForm::configure($schema);
|
||||
}
|
||||
|
||||
public static function table(Table $table): Table
|
||||
{
|
||||
return EducationTable::configure($table);
|
||||
}
|
||||
|
||||
public static function getRelations(): array
|
||||
{
|
||||
return [
|
||||
//
|
||||
];
|
||||
}
|
||||
|
||||
public static function getPages(): array
|
||||
{
|
||||
return [
|
||||
'index' => ListEducation::route('/'),
|
||||
'create' => CreateEducation::route('/create'),
|
||||
'edit' => EditEducation::route('/{record}/edit'),
|
||||
];
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
<?php
|
||||
|
||||
namespace App\Filament\Resources\Education\Pages;
|
||||
|
||||
use App\Filament\Resources\Education\EducationResource;
|
||||
use Filament\Resources\Pages\CreateRecord;
|
||||
|
||||
class CreateEducation extends CreateRecord
|
||||
{
|
||||
protected static string $resource = EducationResource::class;
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
<?php
|
||||
|
||||
namespace App\Filament\Resources\Education\Pages;
|
||||
|
||||
use App\Filament\Resources\Education\EducationResource;
|
||||
use Filament\Actions\DeleteAction;
|
||||
use Filament\Resources\Pages\EditRecord;
|
||||
|
||||
class EditEducation extends EditRecord
|
||||
{
|
||||
protected static string $resource = EducationResource::class;
|
||||
|
||||
protected function getHeaderActions(): array
|
||||
{
|
||||
return [
|
||||
DeleteAction::make(),
|
||||
];
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
<?php
|
||||
|
||||
namespace App\Filament\Resources\Education\Pages;
|
||||
|
||||
use App\Filament\Resources\Education\EducationResource;
|
||||
use Filament\Actions\CreateAction;
|
||||
use Filament\Resources\Pages\ListRecords;
|
||||
|
||||
class ListEducation extends ListRecords
|
||||
{
|
||||
protected static string $resource = EducationResource::class;
|
||||
|
||||
protected function getHeaderActions(): array
|
||||
{
|
||||
return [
|
||||
CreateAction::make(),
|
||||
];
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
<?php
|
||||
|
||||
namespace App\Filament\Resources\Education\Schemas;
|
||||
|
||||
use Filament\Forms\Components\DatePicker;
|
||||
use Filament\Forms\Components\TextInput;
|
||||
use Filament\Forms\Components\Textarea;
|
||||
use Filament\Schemas\Schema;
|
||||
|
||||
class EducationForm
|
||||
{
|
||||
public static function configure(Schema $schema): Schema
|
||||
{
|
||||
return $schema
|
||||
->components([
|
||||
TextInput::make('institution')
|
||||
->required(),
|
||||
TextInput::make('degree'),
|
||||
TextInput::make('field_of_study'),
|
||||
DatePicker::make('start_date'),
|
||||
DatePicker::make('end_date'),
|
||||
Textarea::make('description')
|
||||
->columnSpanFull(),
|
||||
TextInput::make('sort_order')
|
||||
->required()
|
||||
->numeric()
|
||||
->default(0),
|
||||
]);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,54 @@
|
||||
<?php
|
||||
|
||||
namespace App\Filament\Resources\Education\Tables;
|
||||
|
||||
use Filament\Actions\BulkActionGroup;
|
||||
use Filament\Actions\DeleteBulkAction;
|
||||
use Filament\Actions\EditAction;
|
||||
use Filament\Tables\Columns\TextColumn;
|
||||
use Filament\Tables\Table;
|
||||
|
||||
class EducationTable
|
||||
{
|
||||
public static function configure(Table $table): Table
|
||||
{
|
||||
return $table
|
||||
->defaultSort('sort_order')
|
||||
->columns([
|
||||
TextColumn::make('institution')
|
||||
->searchable(),
|
||||
TextColumn::make('degree')
|
||||
->searchable(),
|
||||
TextColumn::make('field_of_study')
|
||||
->searchable(),
|
||||
TextColumn::make('start_date')
|
||||
->date()
|
||||
->sortable(),
|
||||
TextColumn::make('end_date')
|
||||
->date()
|
||||
->sortable(),
|
||||
TextColumn::make('sort_order')
|
||||
->numeric()
|
||||
->sortable(),
|
||||
TextColumn::make('created_at')
|
||||
->dateTime()
|
||||
->sortable()
|
||||
->toggleable(isToggledHiddenByDefault: true),
|
||||
TextColumn::make('updated_at')
|
||||
->dateTime()
|
||||
->sortable()
|
||||
->toggleable(isToggledHiddenByDefault: true),
|
||||
])
|
||||
->filters([
|
||||
//
|
||||
])
|
||||
->recordActions([
|
||||
EditAction::make(),
|
||||
])
|
||||
->toolbarActions([
|
||||
BulkActionGroup::make([
|
||||
DeleteBulkAction::make(),
|
||||
]),
|
||||
]);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user