Skip to content

Commit e6badcd

Browse files
Merge pull request #60 from thethunderturner/feature/create-page-split-form
Feature: Create page split form
2 parents 2b7a1a9 + 9614ae0 commit e6badcd

File tree

1 file changed

+40
-27
lines changed

1 file changed

+40
-27
lines changed

src/Resources/FilamentLatexResource.php

Lines changed: 40 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
namespace TheThunderTurner\FilamentLatex\Resources;
44

55
use Filament\Forms\Components\DateTimePicker;
6+
use Filament\Forms\Components\Group;
67
use Filament\Forms\Components\Section;
78
use Filament\Forms\Components\Select;
89
use Filament\Forms\Components\TextInput;
@@ -49,34 +50,45 @@ public static function form(Form $form): Form
4950

5051
return $form
5152
->schema([
52-
Section::make()
53+
Group::make()
5354
->schema([
54-
TextInput::make('name')
55-
->label(__('filament-latex::filament-latex.field.name'))
56-
->translateLabel()
57-
->required(),
58-
DateTimePicker::make('deadline')
59-
->label(__('filament-latex::filament-latex.field.deadline'))
60-
->required()
61-
->native(false)
62-
->placeholder('DD-MM-YYYY HH:MM')
63-
->suffixIcon('heroicon-m-calendar')
64-
->format('Y-m-d H:i:s')
65-
->displayFormat('d-m-Y H:i'),
66-
Select::make('author_id')
67-
->label(__('filament-latex::filament-latex.field.author_id'))
68-
->default(fn () => Auth::id())
69-
->options(fn () => $userModel::all()->pluck('name', 'id'))
70-
->disabled()
71-
->dehydrated()
72-
->required(),
73-
Select::make('collaborators_id')
74-
->label(__('filament-latex::filament-latex.field.collaborators_id'))
75-
->multiple()
76-
->options(fn () => $userModel::all()->pluck('name', 'id'))
77-
->searchable(),
78-
])->columns(2),
79-
]);
55+
Section::make([
56+
TextInput::make('name')
57+
->label(__('filament-latex::filament-latex.field.name'))
58+
->translateLabel()
59+
->required(),
60+
Select::make('author_id')
61+
->label(__('filament-latex::filament-latex.field.author_id'))
62+
->default(fn () => Auth::id())
63+
->options(fn () => $userModel::all()->pluck('name', 'id'))
64+
->disabled()
65+
->dehydrated()
66+
->required(),
67+
])->columns(2),
68+
])
69+
->columnSpan(['lg' => 2]),
70+
71+
Group::make()
72+
->schema([
73+
Section::make([
74+
DateTimePicker::make('deadline')
75+
->label(__('filament-latex::filament-latex.field.deadline'))
76+
->required()
77+
->native(false)
78+
->placeholder('DD-MM-YYYY HH:MM')
79+
->suffixIcon('heroicon-m-calendar')
80+
->format('Y-m-d H:i:s')
81+
->displayFormat('d-m-Y H:i'),
82+
Select::make('collaborators_id')
83+
->label(__('filament-latex::filament-latex.field.collaborators_id'))
84+
->multiple()
85+
->options(fn () => $userModel::all()->pluck('name', 'id'))
86+
->searchable(),
87+
]),
88+
])
89+
->columnSpan(['lg' => 1]),
90+
])
91+
->columns(3);
8092
}
8193

8294
public static function table(Table $table): Table
@@ -121,6 +133,7 @@ public static function table(Table $table): Table
121133
->label(__('filament-latex::filament-latex.column.collaborators'))
122134
->visible(! config('filament-latex.avatar-columns'))
123135
->badge()
136+
->limit(15)
124137
->color('info')
125138
->getStateUsing(function ($record) use ($userModel) {
126139
return $userModel::whereIn('id', $record->collaborators_id)->pluck('name')->toArray();

0 commit comments

Comments
 (0)