resources and relations

This commit is contained in:
Russ Long 2022-08-07 12:48:05 -04:00
parent 83a89329b8
commit 6e2bdee1c6
27 changed files with 897 additions and 6 deletions

View File

@ -12,6 +12,8 @@ use Filament\Resources\Table;
use Filament\Tables; use Filament\Tables;
use Illuminate\Database\Eloquent\Builder; use Illuminate\Database\Eloquent\Builder;
use Illuminate\Database\Eloquent\SoftDeletingScope; use Illuminate\Database\Eloquent\SoftDeletingScope;
use Filament\Tables\Columns\TextColumn;
use Filament\Forms\Components\TextInput;
class BiddersResource extends Resource class BiddersResource extends Resource
{ {
@ -23,7 +25,15 @@ class BiddersResource extends Resource
{ {
return $form return $form
->schema([ ->schema([
// TextInput::make('bidder_fname')->label('First Name'),
TextInput::make('bidder_lname')->label('Last Name'),
TextInput::make('bidder_addr')->label('Address'),
TextInput::make('bidder_city')->label('City'),
TextInput::make('bidder_state')->label('State'),
TextInput::make('bidder_zip')->label('Zip'),
TextInput::make('bidder_phone')->label('Phone Number'),
TextInput::make('bidder_email')->label('Email'),
TextInput::make('bidder_assigned_number')->label('Assigned Number'),
]); ]);
} }
@ -31,7 +41,15 @@ class BiddersResource extends Resource
{ {
return $table return $table
->columns([ ->columns([
// TextColumn::make('bidder_assigned_number')->sortable()->label('Assigned Number'),
TextColumn::make('bidder_fname')->sortable()->label('First Name'),
TextColumn::make('bidder_lname')->sortable()->label('Last Name'),
TextColumn::make('bidder_addr')->label('Address'),
TextColumn::make('bidder_city')->label('City'),
TextColumn::make('bidder_state')->label('State'),
TextColumn::make('bidder_zip')->label('Zip'),
TextColumn::make('bidder_phone')->label('Phone Number'),
TextColumn::make('bidder_email')->label('Email'),
]) ])
->filters([ ->filters([
// //

View File

@ -0,0 +1,49 @@
<?php
namespace App\Filament\Resources\BiddersResource\RelationManagers;
use Filament\Forms;
use Filament\Resources\Form;
use Filament\Resources\RelationManagers\RelationManager;
use Filament\Resources\Table;
use Filament\Tables;
use Illuminate\Database\Eloquent\Builder;
use Illuminate\Database\Eloquent\SoftDeletingScope;
class CheckoutRelationManager extends RelationManager
{
protected static string $relationship = 'checkout';
protected static ?string $recordTitleAttribute = 'bidder_num';
public static function form(Form $form): Form
{
return $form
->schema([
Forms\Components\TextInput::make('bidder_num')
->required()
->maxLength(255),
]);
}
public static function table(Table $table): Table
{
return $table
->columns([
Tables\Columns\TextColumn::make('bidder_num'),
])
->filters([
//
])
->headerActions([
Tables\Actions\CreateAction::make(),
])
->actions([
Tables\Actions\EditAction::make(),
Tables\Actions\DeleteAction::make(),
])
->bulkActions([
Tables\Actions\DeleteBulkAction::make(),
]);
}
}

View File

@ -0,0 +1,49 @@
<?php
namespace App\Filament\Resources\BiddersResource\RelationManagers;
use Filament\Forms;
use Filament\Resources\Form;
use Filament\Resources\RelationManagers\RelationManager;
use Filament\Resources\Table;
use Filament\Tables;
use Illuminate\Database\Eloquent\Builder;
use Illuminate\Database\Eloquent\SoftDeletingScope;
class VehiclesRelationManager extends RelationManager
{
protected static string $relationship = 'vehicles';
protected static ?string $recordTitleAttribute = 'owner';
public static function form(Form $form): Form
{
return $form
->schema([
Forms\Components\TextInput::make('owner')
->required()
->maxLength(255),
]);
}
public static function table(Table $table): Table
{
return $table
->columns([
Tables\Columns\TextColumn::make('owner'),
])
->filters([
//
])
->headerActions([
Tables\Actions\CreateAction::make(),
])
->actions([
Tables\Actions\EditAction::make(),
Tables\Actions\DeleteAction::make(),
])
->bulkActions([
Tables\Actions\DeleteBulkAction::make(),
]);
}
}

View File

@ -0,0 +1,49 @@
<?php
namespace App\Filament\Resources\BiddersResource\RelationManagers;
use Filament\Forms;
use Filament\Resources\Form;
use Filament\Resources\RelationManagers\RelationManager;
use Filament\Resources\Table;
use Filament\Tables;
use Illuminate\Database\Eloquent\Builder;
use Illuminate\Database\Eloquent\SoftDeletingScope;
class WinningBidsRelationManager extends RelationManager
{
protected static string $relationship = 'winningBids';
protected static ?string $recordTitleAttribute = 'winning_bidder_num';
public static function form(Form $form): Form
{
return $form
->schema([
Forms\Components\TextInput::make('winning_bidder_num')
->required()
->maxLength(255),
]);
}
public static function table(Table $table): Table
{
return $table
->columns([
Tables\Columns\TextColumn::make('winning_bidder_num'),
])
->filters([
//
])
->headerActions([
Tables\Actions\CreateAction::make(),
])
->actions([
Tables\Actions\EditAction::make(),
Tables\Actions\DeleteAction::make(),
])
->bulkActions([
Tables\Actions\DeleteBulkAction::make(),
]);
}
}

View File

@ -39,7 +39,6 @@ class CarShowCategoryResource extends Resource
->columns([ ->columns([
TextColumn::make('category_name')->sortable(), TextColumn::make('category_name')->sortable(),
BooleanColumn::make('vehicle_type')->sortable(), BooleanColumn::make('vehicle_type')->sortable(),
]) ])
->filters([ ->filters([
// //

View File

@ -12,6 +12,13 @@ use Filament\Resources\Table;
use Filament\Tables; use Filament\Tables;
use Illuminate\Database\Eloquent\Builder; use Illuminate\Database\Eloquent\Builder;
use Illuminate\Database\Eloquent\SoftDeletingScope; use Illuminate\Database\Eloquent\SoftDeletingScope;
use Filament\Tables\Columns\BooleanColumn;
use Filament\Tables\Columns\TextColumn;
use Filament\Forms\Components\TextInput;
use Filament\Forms\Components\Toggle;
use Filament\Forms\Components\Select;
use App\Models\Vehicles;
use App\Models\CarShowCategory;
class CarShowWinnerResource extends Resource class CarShowWinnerResource extends Resource
{ {
@ -23,7 +30,14 @@ class CarShowWinnerResource extends Resource
{ {
return $form return $form
->schema([ ->schema([
// Select::make('vehicle')
->label('Vehicle')
->options(Vehicles::all()->pluck('owner', 'year', 'make', 'model', 'id'))
->searchable(),
Select::make('category')
->label('Category')
->options(CarShowCategory::all()->pluck('category_name', 'vehicle_type', 'id'))
->searchable(),
]); ]);
} }
@ -31,8 +45,9 @@ class CarShowWinnerResource extends Resource
{ {
return $table return $table
->columns([ ->columns([
// TextColumn::make('awardVehicle.owner')->label('Vehicle'),
]) TextColumn::make('awardCategory.category_name')->label('Category'),
])
->filters([ ->filters([
// //
]) ])

View File

@ -0,0 +1,49 @@
<?php
namespace App\Filament\Resources\CarShowWinnerResource\RelationManagers;
use Filament\Forms;
use Filament\Resources\Form;
use Filament\Resources\RelationManagers\RelationManager;
use Filament\Resources\Table;
use Filament\Tables;
use Illuminate\Database\Eloquent\Builder;
use Illuminate\Database\Eloquent\SoftDeletingScope;
class AwardCategoryRelationManager extends RelationManager
{
protected static string $relationship = 'awardCategory';
protected static ?string $recordTitleAttribute = 'id';
public static function form(Form $form): Form
{
return $form
->schema([
Forms\Components\TextInput::make('id')
->required()
->maxLength(255),
]);
}
public static function table(Table $table): Table
{
return $table
->columns([
Tables\Columns\TextColumn::make('id'),
])
->filters([
//
])
->headerActions([
Tables\Actions\CreateAction::make(),
])
->actions([
Tables\Actions\EditAction::make(),
Tables\Actions\DeleteAction::make(),
])
->bulkActions([
Tables\Actions\DeleteBulkAction::make(),
]);
}
}

View File

@ -0,0 +1,49 @@
<?php
namespace App\Filament\Resources\CarShowWinnerResource\RelationManagers;
use Filament\Forms;
use Filament\Resources\Form;
use Filament\Resources\RelationManagers\RelationManager;
use Filament\Resources\Table;
use Filament\Tables;
use Illuminate\Database\Eloquent\Builder;
use Illuminate\Database\Eloquent\SoftDeletingScope;
class AwardVehicleRelationManager extends RelationManager
{
protected static string $relationship = 'awardVehicle';
protected static ?string $recordTitleAttribute = 'id';
public static function form(Form $form): Form
{
return $form
->schema([
Forms\Components\TextInput::make('id')
->required()
->maxLength(255),
]);
}
public static function table(Table $table): Table
{
return $table
->columns([
Tables\Columns\TextColumn::make('id'),
])
->filters([
//
])
->headerActions([
Tables\Actions\CreateAction::make(),
])
->actions([
Tables\Actions\EditAction::make(),
Tables\Actions\DeleteAction::make(),
])
->bulkActions([
Tables\Actions\DeleteBulkAction::make(),
]);
}
}

View File

@ -12,6 +12,10 @@ use Filament\Resources\Table;
use Filament\Tables; use Filament\Tables;
use Illuminate\Database\Eloquent\Builder; use Illuminate\Database\Eloquent\Builder;
use Illuminate\Database\Eloquent\SoftDeletingScope; use Illuminate\Database\Eloquent\SoftDeletingScope;
use Filament\Tables\Columns\BooleanColumn;
use Filament\Tables\Columns\TextColumn;
use Filament\Forms\Components\TextInput;
use Filament\Forms\Components\Toggle;
class CheckoutResource extends Resource class CheckoutResource extends Resource
{ {

View File

@ -0,0 +1,49 @@
<?php
namespace App\Filament\Resources\CheckoutResource\RelationManagers;
use Filament\Forms;
use Filament\Resources\Form;
use Filament\Resources\RelationManagers\RelationManager;
use Filament\Resources\Table;
use Filament\Tables;
use Illuminate\Database\Eloquent\Builder;
use Illuminate\Database\Eloquent\SoftDeletingScope;
class BiddersRelationManager extends RelationManager
{
protected static string $relationship = 'bidders';
protected static ?string $recordTitleAttribute = 'bidder_num';
public static function form(Form $form): Form
{
return $form
->schema([
Forms\Components\TextInput::make('bidder_num')
->required()
->maxLength(255),
]);
}
public static function table(Table $table): Table
{
return $table
->columns([
Tables\Columns\TextColumn::make('bidder_num'),
])
->filters([
//
])
->headerActions([
Tables\Actions\CreateAction::make(),
])
->actions([
Tables\Actions\EditAction::make(),
Tables\Actions\DeleteAction::make(),
])
->bulkActions([
Tables\Actions\DeleteBulkAction::make(),
]);
}
}

View File

@ -0,0 +1,49 @@
<?php
namespace App\Filament\Resources\CheckoutResource\RelationManagers;
use Filament\Forms;
use Filament\Resources\Form;
use Filament\Resources\RelationManagers\RelationManager;
use Filament\Resources\Table;
use Filament\Tables;
use Illuminate\Database\Eloquent\Builder;
use Illuminate\Database\Eloquent\SoftDeletingScope;
class PaymentMethodRelationManager extends RelationManager
{
protected static string $relationship = 'paymentMethod';
protected static ?string $recordTitleAttribute = 'payment_method';
public static function form(Form $form): Form
{
return $form
->schema([
Forms\Components\TextInput::make('payment_method')
->required()
->maxLength(255),
]);
}
public static function table(Table $table): Table
{
return $table
->columns([
Tables\Columns\TextColumn::make('payment_method'),
])
->filters([
//
])
->headerActions([
Tables\Actions\CreateAction::make(),
])
->actions([
Tables\Actions\EditAction::make(),
Tables\Actions\DeleteAction::make(),
])
->bulkActions([
Tables\Actions\DeleteBulkAction::make(),
]);
}
}

View File

@ -12,6 +12,10 @@ use Filament\Resources\Table;
use Filament\Tables; use Filament\Tables;
use Illuminate\Database\Eloquent\Builder; use Illuminate\Database\Eloquent\Builder;
use Illuminate\Database\Eloquent\SoftDeletingScope; use Illuminate\Database\Eloquent\SoftDeletingScope;
use Filament\Tables\Columns\BooleanColumn;
use Filament\Tables\Columns\TextColumn;
use Filament\Forms\Components\TextInput;
use Filament\Forms\Components\Toggle;
class ItemsResource extends Resource class ItemsResource extends Resource
{ {

View File

@ -0,0 +1,49 @@
<?php
namespace App\Filament\Resources\ItemsResource\RelationManagers;
use Filament\Forms;
use Filament\Resources\Form;
use Filament\Resources\RelationManagers\RelationManager;
use Filament\Resources\Table;
use Filament\Tables;
use Illuminate\Database\Eloquent\Builder;
use Illuminate\Database\Eloquent\SoftDeletingScope;
class WinningBidsRelationManager extends RelationManager
{
protected static string $relationship = 'winningBids';
protected static ?string $recordTitleAttribute = 'iditems';
public static function form(Form $form): Form
{
return $form
->schema([
Forms\Components\TextInput::make('iditems')
->required()
->maxLength(255),
]);
}
public static function table(Table $table): Table
{
return $table
->columns([
Tables\Columns\TextColumn::make('iditems'),
])
->filters([
//
])
->headerActions([
Tables\Actions\CreateAction::make(),
])
->actions([
Tables\Actions\EditAction::make(),
Tables\Actions\DeleteAction::make(),
])
->bulkActions([
Tables\Actions\DeleteBulkAction::make(),
]);
}
}

View File

@ -0,0 +1,49 @@
<?php
namespace App\Filament\Resources\JudgesResource\RelationManagers;
use Filament\Forms;
use Filament\Resources\Form;
use Filament\Resources\RelationManagers\RelationManager;
use Filament\Resources\Table;
use Filament\Tables;
use Illuminate\Database\Eloquent\Builder;
use Illuminate\Database\Eloquent\SoftDeletingScope;
class VehicleScoresRelationManager extends RelationManager
{
protected static string $relationship = 'vehicleScores';
protected static ?string $recordTitleAttribute = 'judge';
public static function form(Form $form): Form
{
return $form
->schema([
Forms\Components\TextInput::make('judge')
->required()
->maxLength(255),
]);
}
public static function table(Table $table): Table
{
return $table
->columns([
Tables\Columns\TextColumn::make('judge'),
])
->filters([
//
])
->headerActions([
Tables\Actions\CreateAction::make(),
])
->actions([
Tables\Actions\EditAction::make(),
Tables\Actions\DeleteAction::make(),
])
->bulkActions([
Tables\Actions\DeleteBulkAction::make(),
]);
}
}

View File

@ -12,6 +12,8 @@ use Filament\Resources\Table;
use Filament\Tables; use Filament\Tables;
use Illuminate\Database\Eloquent\Builder; use Illuminate\Database\Eloquent\Builder;
use Illuminate\Database\Eloquent\SoftDeletingScope; use Illuminate\Database\Eloquent\SoftDeletingScope;
use Filament\Tables\Columns\TextColumn;
use Filament\Forms\Components\TextInput;
class PaymentMethodsResource extends Resource class PaymentMethodsResource extends Resource
{ {

View File

@ -0,0 +1,49 @@
<?php
namespace App\Filament\Resources\PaymentMethodsResource\RelationManagers;
use Filament\Forms;
use Filament\Resources\Form;
use Filament\Resources\RelationManagers\RelationManager;
use Filament\Resources\Table;
use Filament\Tables;
use Illuminate\Database\Eloquent\Builder;
use Illuminate\Database\Eloquent\SoftDeletingScope;
class CheckoutRelationManager extends RelationManager
{
protected static string $relationship = 'checkout';
protected static ?string $recordTitleAttribute = 'payment_method';
public static function form(Form $form): Form
{
return $form
->schema([
Forms\Components\TextInput::make('payment_method')
->required()
->maxLength(255),
]);
}
public static function table(Table $table): Table
{
return $table
->columns([
Tables\Columns\TextColumn::make('payment_method'),
])
->filters([
//
])
->headerActions([
Tables\Actions\CreateAction::make(),
])
->actions([
Tables\Actions\EditAction::make(),
Tables\Actions\DeleteAction::make(),
])
->bulkActions([
Tables\Actions\DeleteBulkAction::make(),
]);
}
}

View File

@ -12,6 +12,10 @@ use Filament\Resources\Table;
use Filament\Tables; use Filament\Tables;
use Illuminate\Database\Eloquent\Builder; use Illuminate\Database\Eloquent\Builder;
use Illuminate\Database\Eloquent\SoftDeletingScope; use Illuminate\Database\Eloquent\SoftDeletingScope;
use Filament\Tables\Columns\BooleanColumn;
use Filament\Tables\Columns\TextColumn;
use Filament\Forms\Components\TextInput;
use Filament\Forms\Components\Toggle;
class PeoplesChoiceResource extends Resource class PeoplesChoiceResource extends Resource
{ {

View File

@ -0,0 +1,49 @@
<?php
namespace App\Filament\Resources\PeoplesChoiceResource\RelationManagers;
use Filament\Forms;
use Filament\Resources\Form;
use Filament\Resources\RelationManagers\RelationManager;
use Filament\Resources\Table;
use Filament\Tables;
use Illuminate\Database\Eloquent\Builder;
use Illuminate\Database\Eloquent\SoftDeletingScope;
class VehiclesRelationManager extends RelationManager
{
protected static string $relationship = 'vehicles';
protected static ?string $recordTitleAttribute = 'vehicle';
public static function form(Form $form): Form
{
return $form
->schema([
Forms\Components\TextInput::make('vehicle')
->required()
->maxLength(255),
]);
}
public static function table(Table $table): Table
{
return $table
->columns([
Tables\Columns\TextColumn::make('vehicle'),
])
->filters([
//
])
->headerActions([
Tables\Actions\CreateAction::make(),
])
->actions([
Tables\Actions\EditAction::make(),
Tables\Actions\DeleteAction::make(),
])
->bulkActions([
Tables\Actions\DeleteBulkAction::make(),
]);
}
}

View File

@ -12,6 +12,10 @@ use Filament\Resources\Table;
use Filament\Tables; use Filament\Tables;
use Illuminate\Database\Eloquent\Builder; use Illuminate\Database\Eloquent\Builder;
use Illuminate\Database\Eloquent\SoftDeletingScope; use Illuminate\Database\Eloquent\SoftDeletingScope;
use Filament\Tables\Columns\BooleanColumn;
use Filament\Tables\Columns\TextColumn;
use Filament\Forms\Components\TextInput;
use Filament\Forms\Components\Toggle;
class VehicleScoresResource extends Resource class VehicleScoresResource extends Resource
{ {

View File

@ -0,0 +1,49 @@
<?php
namespace App\Filament\Resources\VehicleScoresResource\RelationManagers;
use Filament\Forms;
use Filament\Resources\Form;
use Filament\Resources\RelationManagers\RelationManager;
use Filament\Resources\Table;
use Filament\Tables;
use Illuminate\Database\Eloquent\Builder;
use Illuminate\Database\Eloquent\SoftDeletingScope;
class JudgeRelationManager extends RelationManager
{
protected static string $relationship = 'judge';
protected static ?string $recordTitleAttribute = 'judge';
public static function form(Form $form): Form
{
return $form
->schema([
Forms\Components\TextInput::make('judge')
->required()
->maxLength(255),
]);
}
public static function table(Table $table): Table
{
return $table
->columns([
Tables\Columns\TextColumn::make('judge'),
])
->filters([
//
])
->headerActions([
Tables\Actions\CreateAction::make(),
])
->actions([
Tables\Actions\EditAction::make(),
Tables\Actions\DeleteAction::make(),
])
->bulkActions([
Tables\Actions\DeleteBulkAction::make(),
]);
}
}

View File

@ -0,0 +1,49 @@
<?php
namespace App\Filament\Resources\VehicleScoresResource\RelationManagers;
use Filament\Forms;
use Filament\Resources\Form;
use Filament\Resources\RelationManagers\RelationManager;
use Filament\Resources\Table;
use Filament\Tables;
use Illuminate\Database\Eloquent\Builder;
use Illuminate\Database\Eloquent\SoftDeletingScope;
class ScoredVehicleRelationManager extends RelationManager
{
protected static string $relationship = 'scoredVehicle';
protected static ?string $recordTitleAttribute = 'id';
public static function form(Form $form): Form
{
return $form
->schema([
Forms\Components\TextInput::make('id')
->required()
->maxLength(255),
]);
}
public static function table(Table $table): Table
{
return $table
->columns([
Tables\Columns\TextColumn::make('id'),
])
->filters([
//
])
->headerActions([
Tables\Actions\CreateAction::make(),
])
->actions([
Tables\Actions\EditAction::make(),
Tables\Actions\DeleteAction::make(),
])
->bulkActions([
Tables\Actions\DeleteBulkAction::make(),
]);
}
}

View File

@ -12,6 +12,10 @@ use Filament\Resources\Table;
use Filament\Tables; use Filament\Tables;
use Illuminate\Database\Eloquent\Builder; use Illuminate\Database\Eloquent\Builder;
use Illuminate\Database\Eloquent\SoftDeletingScope; use Illuminate\Database\Eloquent\SoftDeletingScope;
use Filament\Tables\Columns\BooleanColumn;
use Filament\Tables\Columns\TextColumn;
use Filament\Forms\Components\TextInput;
use Filament\Forms\Components\Toggle;
class VehiclesResource extends Resource class VehiclesResource extends Resource
{ {

View File

@ -0,0 +1,49 @@
<?php
namespace App\Filament\Resources\VehiclesResource\RelationManagers;
use Filament\Forms;
use Filament\Resources\Form;
use Filament\Resources\RelationManagers\RelationManager;
use Filament\Resources\Table;
use Filament\Tables;
use Illuminate\Database\Eloquent\Builder;
use Illuminate\Database\Eloquent\SoftDeletingScope;
class CarShowWinnerRelationManager extends RelationManager
{
protected static string $relationship = 'CarShowWinner';
protected static ?string $recordTitleAttribute = 'id';
public static function form(Form $form): Form
{
return $form
->schema([
Forms\Components\TextInput::make('id')
->required()
->maxLength(255),
]);
}
public static function table(Table $table): Table
{
return $table
->columns([
Tables\Columns\TextColumn::make('id'),
])
->filters([
//
])
->headerActions([
Tables\Actions\CreateAction::make(),
])
->actions([
Tables\Actions\EditAction::make(),
Tables\Actions\DeleteAction::make(),
])
->bulkActions([
Tables\Actions\DeleteBulkAction::make(),
]);
}
}

View File

@ -0,0 +1,49 @@
<?php
namespace App\Filament\Resources\VehiclesResource\RelationManagers;
use Filament\Forms;
use Filament\Resources\Form;
use Filament\Resources\RelationManagers\RelationManager;
use Filament\Resources\Table;
use Filament\Tables;
use Illuminate\Database\Eloquent\Builder;
use Illuminate\Database\Eloquent\SoftDeletingScope;
class VehicleOwnerRelationManager extends RelationManager
{
protected static string $relationship = 'vehicleOwner';
protected static ?string $recordTitleAttribute = 'owner';
public static function form(Form $form): Form
{
return $form
->schema([
Forms\Components\TextInput::make('owner')
->required()
->maxLength(255),
]);
}
public static function table(Table $table): Table
{
return $table
->columns([
Tables\Columns\TextColumn::make('owner'),
])
->filters([
//
])
->headerActions([
Tables\Actions\CreateAction::make(),
])
->actions([
Tables\Actions\EditAction::make(),
Tables\Actions\DeleteAction::make(),
])
->bulkActions([
Tables\Actions\DeleteBulkAction::make(),
]);
}
}

View File

@ -0,0 +1,49 @@
<?php
namespace App\Filament\Resources\VehiclesResource\RelationManagers;
use Filament\Forms;
use Filament\Resources\Form;
use Filament\Resources\RelationManagers\RelationManager;
use Filament\Resources\Table;
use Filament\Tables;
use Illuminate\Database\Eloquent\Builder;
use Illuminate\Database\Eloquent\SoftDeletingScope;
class VehicleScoresRelationManager extends RelationManager
{
protected static string $relationship = 'vehicleScores';
protected static ?string $recordTitleAttribute = 'id';
public static function form(Form $form): Form
{
return $form
->schema([
Forms\Components\TextInput::make('id')
->required()
->maxLength(255),
]);
}
public static function table(Table $table): Table
{
return $table
->columns([
Tables\Columns\TextColumn::make('id'),
])
->filters([
//
])
->headerActions([
Tables\Actions\CreateAction::make(),
])
->actions([
Tables\Actions\EditAction::make(),
Tables\Actions\DeleteAction::make(),
])
->bulkActions([
Tables\Actions\DeleteBulkAction::make(),
]);
}
}

View File

@ -0,0 +1,49 @@
<?php
namespace App\Filament\Resources\VehiclesResource\RelationManagers;
use Filament\Forms;
use Filament\Resources\Form;
use Filament\Resources\RelationManagers\RelationManager;
use Filament\Resources\Table;
use Filament\Tables;
use Illuminate\Database\Eloquent\Builder;
use Illuminate\Database\Eloquent\SoftDeletingScope;
class VehicleTypeRelationManager extends RelationManager
{
protected static string $relationship = 'vehicleType';
protected static ?string $recordTitleAttribute = 'type';
public static function form(Form $form): Form
{
return $form
->schema([
Forms\Components\TextInput::make('type')
->required()
->maxLength(255),
]);
}
public static function table(Table $table): Table
{
return $table
->columns([
Tables\Columns\TextColumn::make('type'),
])
->filters([
//
])
->headerActions([
Tables\Actions\CreateAction::make(),
])
->actions([
Tables\Actions\EditAction::make(),
Tables\Actions\DeleteAction::make(),
])
->bulkActions([
Tables\Actions\DeleteBulkAction::make(),
]);
}
}

View File

@ -12,6 +12,10 @@ use Filament\Resources\Table;
use Filament\Tables; use Filament\Tables;
use Illuminate\Database\Eloquent\Builder; use Illuminate\Database\Eloquent\Builder;
use Illuminate\Database\Eloquent\SoftDeletingScope; use Illuminate\Database\Eloquent\SoftDeletingScope;
use Filament\Tables\Columns\BooleanColumn;
use Filament\Tables\Columns\TextColumn;
use Filament\Forms\Components\TextInput;
use Filament\Forms\Components\Toggle;
class WinningBidsResource extends Resource class WinningBidsResource extends Resource
{ {