feat: make sidebar collapsible

This commit is contained in:
jon brookes 2026-01-07 16:11:33 +00:00
parent d187671a34
commit e56db6634b
2 changed files with 12 additions and 11 deletions

View file

@ -27,6 +27,7 @@ class AdminPanelProvider extends PanelProvider
{ {
return $panel return $panel
->default() ->default()
->sidebarCollapsibleOnDesktop()
->id('admin') ->id('admin')
->path('admin') ->path('admin')
->login() ->login()
@ -63,7 +64,7 @@ class AdminPanelProvider extends PanelProvider
{ {
FilamentView::registerRenderHook( FilamentView::registerRenderHook(
PanelsRenderHook::BODY_END, PanelsRenderHook::BODY_END,
fn (): string => \Illuminate\Support\Facades\Blade::render('@vite("resources/js/app.js")'), fn(): string => \Illuminate\Support\Facades\Blade::render('@vite("resources/js/app.js")'),
); );
} }
} }

View file

@ -55,14 +55,14 @@ Full CRUD is already possible. This is amazing if you think how long this would
### slugify ### slugify
```php ```php
TextInput::make('title') TextInput::make('title')
->required() ->required()
->reactive() ->reactive()
->afterStateUpdated(function ($state, $set): void { ->afterStateUpdated(function ($state, $set): void {
$set('slug', Str::slug((string) $state)); $set('slug', Str::slug((string) $state));
}), }),
TextInput::make('slug') TextInput::make('slug')
->required(), ->required(),
``` ```
adding reactive and afterStateUpdted to title automatically creates a safe slug adding reactive and afterStateUpdted to title automatically creates a safe slug
@ -76,8 +76,8 @@ For the user, this reduces error and confusion over what a url should be
just changing the TextInput for content just changing the TextInput for content
```php ```php
RichEditor::make('content') RichEditor::make('content')
->columnSpanFull(), ->columnSpanFull(),
``` ```
to `RichEditr` gives us a 'tiptap' rich text editor to `RichEditr` gives us a 'tiptap' rich text editor