Skip to content

Commit

Permalink
Configure purchase assignment form.
Browse files Browse the repository at this point in the history
  • Loading branch information
timvandijck committed Mar 6, 2024
1 parent f7513af commit 16dffe4
Showing 1 changed file with 37 additions and 1 deletion.
38 changes: 37 additions & 1 deletion app/Filament/Resources/Customers/PurchaseAssignmentResource.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,11 @@
use App\Filament\Resources\Customers;
use App\Filament\Tables\Columns\BooleanColumn;
use App\Filament\Tables\Columns\ResourceLinkColumn;
use Filament\Forms\Components\Checkbox;
use Filament\Forms\Components\DateTimePicker;
use Filament\Forms\Components\Grid;
use Filament\Forms\Components\Select;
use Filament\Forms\Components\TextInput;
use Filament\Forms\Form;
use Filament\Resources\Resource;
use Filament\Tables;
Expand All @@ -26,7 +31,38 @@ public static function form(Form $form): Form
{
return $form
->schema([
//
Grid::make(2)
->schema([
TextInput::make('id')
->disabled(),

Select::make('user_id')
->relationship(name: 'user')
->getOptionLabelFromRecordUsing(fn ($record) => $record->email ?? '')
->searchable(['email'])
->columnStart(1),

Select::make('purchase_id')
->relationship(name: 'purchase')
->getOptionLabelFromRecordUsing(fn ($record) => $record->id ?? '')
->searchable(['title'])
->columnStart(1),

Select::make('purchasable_id')
->relationship(name: 'purchasable')
->getOptionLabelFromRecordUsing(fn ($record) => $record->title ?? '')
->searchable(['title'])
->columnStart(1),

Checkbox::make('has_repository_access')
->disabled()
->inline()
->columnStart(1),

DateTimePicker::make('created_at')
->disabled()
->columnStart(1),
])
]);
}

Expand Down

0 comments on commit 16dffe4

Please sign in to comment.