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:
commit
b033262bd7
2 changed files with 12 additions and 11 deletions
|
|
@ -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")'),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue