Merge pull request 'feat: make sidebar collapsible' (#6) from test/write-an-article into dev

Reviewed-on: https://codeberg.org/headshed/share-lt/pulls/6
This commit is contained in:
Jon Brookes 2026-01-07 17:15:21 +01:00
commit b033262bd7
2 changed files with 12 additions and 11 deletions

View file

@ -27,6 +27,7 @@ class AdminPanelProvider extends PanelProvider
{
return $panel
->default()
->sidebarCollapsibleOnDesktop()
->id('admin')
->path('admin')
->login()
@ -63,7 +64,7 @@ class AdminPanelProvider extends PanelProvider
{
FilamentView::registerRenderHook(
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
```php
TextInput::make('title')
->required()
->reactive()
->afterStateUpdated(function ($state, $set): void {
$set('slug', Str::slug((string) $state));
}),
TextInput::make('slug')
->required(),
TextInput::make('title')
->required()
->reactive()
->afterStateUpdated(function ($state, $set): void {
$set('slug', Str::slug((string) $state));
}),
TextInput::make('slug')
->required(),
```
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
```php
RichEditor::make('content')
->columnSpanFull(),
RichEditor::make('content')
->columnSpanFull(),
```
to `RichEditr` gives us a 'tiptap' rich text editor