This commit is contained in:
Bozhidar 2024-04-27 14:05:27 +03:00
parent 11d32fcefe
commit 35a6305d93
5 changed files with 122 additions and 1 deletions

View file

@ -4,7 +4,6 @@ namespace Modules\Docker\App\Models;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Modules\Docker\Database\factories\DockerTemplateFactory;
class DockerTemplate extends Model
{

View file

@ -0,0 +1,72 @@
<?php
namespace Modules\Docker\Filament\Clusters\Docker\Resources;
use Modules\Customer\App\Filament\Resources\DockerTemplateResource\Pages;
use Modules\Customer\App\Filament\Resources\DockerTemplateResource\RelationManagers;
use Filament\Forms;
use Filament\Forms\Form;
use Filament\Resources\Resource;
use Filament\Tables;
use Filament\Tables\Table;
use Illuminate\Database\Eloquent\Builder;
use Illuminate\Database\Eloquent\SoftDeletingScope;
use Modules\Docker\App\Models\DockerTemplate;
class DockerTemplateResource extends Resource
{
protected static ?string $navigationGroup = 'Docker';
protected static ?string $navigationLabel = 'Templates';
protected static ?string $slug = 'docker/templates';
protected static ?string $model = DockerTemplate::class;
protected static ?string $navigationIcon = 'heroicon-o-rectangle-stack';
public static function form(Form $form): Form
{
return $form
->schema([
//
]);
}
public static function table(Table $table): Table
{
return $table
->columns([
//
])
->filters([
//
])
->actions([
Tables\Actions\EditAction::make(),
])
->bulkActions([
Tables\Actions\BulkActionGroup::make([
Tables\Actions\DeleteBulkAction::make(),
]),
]);
}
public static function getRelations(): array
{
return [
//
];
}
public static function getPages(): array
{
return [
'index' => Pages\ListDockerTemplates::route('/'),
'create' => Pages\CreateDockerTemplate::route('/create'),
'edit' => Pages\EditDockerTemplate::route('/{record}/edit'),
];
}
}

View file

@ -0,0 +1,12 @@
<?php
namespace Modules\Docker\Filament\Clusters\Docker\Resources\DockerTemplateResource\Pages;
use Modules\Docker\Filament\Clusters\Docker\Resources\DockerTemplateResource;
use Filament\Actions;
use Filament\Resources\Pages\CreateRecord;
class CreateDockerTemplate extends CreateRecord
{
protected static string $resource = DockerTemplateResource::class;
}

View file

@ -0,0 +1,19 @@
<?php
namespace Modules\Docker\Filament\Clusters\Docker\Resources\DockerTemplateResource\Pages;
use Modules\Docker\Filament\Clusters\Docker\Resources\DockerTemplateResource;
use Filament\Actions;
use Filament\Resources\Pages\EditRecord;
class EditDockerTemplate extends EditRecord
{
protected static string $resource = DockerTemplateResource::class;
protected function getHeaderActions(): array
{
return [
Actions\DeleteAction::make(),
];
}
}

View file

@ -0,0 +1,19 @@
<?php
namespace Modules\Docker\Filament\Clusters\Docker\Resources\DockerTemplateResource\Pages;
use Filament\Actions;
use Filament\Resources\Pages\ListRecords;
use Modules\Docker\Filament\Clusters\Docker\Resources\DockerTemplateResource;
class ListDockerTemplates extends ListRecords
{
protected static string $resource = DockerTemplateResource::class;
protected function getHeaderActions(): array
{
return [
Actions\CreateAction::make(),
];
}
}