mirror of
https://github.com/nihonbuzz/nihonbuzz-academy.git
synced 2026-01-27 02:41:58 +07:00
61 lines
1.7 KiB
PHP
61 lines
1.7 KiB
PHP
<?php
|
|
|
|
namespace App\Filament\Admin\Resources\Lessons;
|
|
|
|
use App\Filament\Admin\Resources\Lessons\Pages\CreateLesson;
|
|
use App\Filament\Admin\Resources\Lessons\Pages\EditLesson;
|
|
use App\Filament\Admin\Resources\Lessons\Pages\ListLessons;
|
|
use App\Filament\Admin\Resources\Lessons\Schemas\LessonForm;
|
|
use App\Filament\Admin\Resources\Lessons\Tables\LessonsTable;
|
|
use App\Models\Lesson;
|
|
use BackedEnum;
|
|
use Filament\Resources\Resource;
|
|
use Filament\Schemas\Schema;
|
|
use Filament\Support\Icons\Heroicon;
|
|
use Filament\Tables\Table;
|
|
use Illuminate\Database\Eloquent\Builder;
|
|
use Illuminate\Database\Eloquent\SoftDeletingScope;
|
|
|
|
class LessonResource extends Resource
|
|
{
|
|
protected static ?string $model = Lesson::class;
|
|
|
|
protected static string|BackedEnum|null $navigationIcon = Heroicon::OutlinedRectangleStack;
|
|
|
|
protected static ?string $recordTitleAttribute = 'title';
|
|
|
|
public static function form(Schema $schema): Schema
|
|
{
|
|
return LessonForm::configure($schema);
|
|
}
|
|
|
|
public static function table(Table $table): Table
|
|
{
|
|
return LessonsTable::configure($table);
|
|
}
|
|
|
|
public static function getRelations(): array
|
|
{
|
|
return [
|
|
//
|
|
];
|
|
}
|
|
|
|
public static function getPages(): array
|
|
{
|
|
return [
|
|
'index' => ListLessons::route('/'),
|
|
'create' => CreateLesson::route('/create'),
|
|
'edit' => EditLesson::route('/{record}/edit'),
|
|
];
|
|
}
|
|
|
|
public static function getRecordRouteBindingEloquentQuery(): Builder
|
|
{
|
|
return parent::getRecordRouteBindingEloquentQuery()
|
|
->withoutGlobalScopes([
|
|
SoftDeletingScope::class,
|
|
]);
|
|
}
|
|
}
|