Tests / metadata (push) Canceled after 0s
Tests / nova-credentials (push) Canceled after 0s
Tests / PHP 8.2 (push) Canceled after 0s
Tests / PHP 8.3 (push) Canceled after 0s
Tests / PHP 8.4 (push) Canceled after 0s
Tests / PHP 8.5 (push) Canceled after 0s
84 lines
2.9 KiB
Markdown
84 lines
2.9 KiB
Markdown
# Nova Form Dock
|
|
|
|
[](https://github.com/MeghdadFadaee/nova-form-dock/actions/workflows/tests.yml)
|
|
[](https://packagist.org/packages/meghdadfadaee/nova-form-dock)
|
|
[](LICENSE.md)
|
|
|
|
Nova Form Dock adds an adaptive action dock to long Laravel Nova 5 resource
|
|
forms. It keeps Nova's original form buttons and behavior while making those
|
|
actions continuously available on long create and update pages.
|
|
|
|
## Features
|
|
|
|
- Activates only when a form is taller than the viewport by default.
|
|
- Supports create and update pages without changing Nova resources.
|
|
- Excludes inline relationship modals and attached-resource forms.
|
|
- Measures the dock so it never covers the final form fields.
|
|
- Follows Nova's content width, including responsive and RTL layouts.
|
|
- Supports top, bottom, left, and right docks with configurable alignment.
|
|
- Supports Nova dark mode, compact mobile actions, safe areas, and reduced motion.
|
|
- Ships compiled assets; consuming applications do not need an NPM build.
|
|
|
|
## Installation
|
|
|
|
Install this package in an existing Laravel Nova 5.9.5 or newer application.
|
|
Your application must already have valid Composer credentials for Nova's
|
|
licensed package repository.
|
|
|
|
```bash
|
|
composer require meghdadfadaee/nova-form-dock
|
|
```
|
|
|
|
The service provider is discovered automatically. To publish the optional
|
|
configuration file:
|
|
|
|
```bash
|
|
php artisan vendor:publish --tag=nova-form-dock-config
|
|
```
|
|
|
|
## Configuration
|
|
|
|
Use `mode => 'always'` to dock supported forms regardless of their height. The
|
|
`resources.only` and `resources.except` arrays accept Nova resource URI keys.
|
|
|
|
```php
|
|
return [
|
|
'enabled' => true,
|
|
'mode' => 'automatic',
|
|
'minimum_form_height' => null,
|
|
'forms' => [
|
|
'create' => true,
|
|
'update' => true,
|
|
],
|
|
'resources' => [
|
|
'only' => [],
|
|
'except' => [],
|
|
],
|
|
'appearance' => [
|
|
'position' => 'bottom',
|
|
'mobile_position' => 'bottom',
|
|
'alignment' => 'end',
|
|
'compact_mobile' => true,
|
|
'floating_gap' => 12,
|
|
],
|
|
];
|
|
```
|
|
|
|
When `minimum_form_height` is `null`, the current viewport height is used as
|
|
the activation threshold.
|
|
|
|
`position` and `mobile_position` accept `top`, `bottom`, `left`, or `right`.
|
|
Keeping `mobile_position` set to `bottom` gives side docks a more usable mobile
|
|
fallback. `alignment` accepts `start`, `center`, or `end`; start and end follow
|
|
the document direction for horizontal docks.
|
|
|
|
## Compatibility
|
|
|
|
This release targets Laravel Nova 5.9.5 or newer and PHP 8.2 or newer. The
|
|
package fails safely when it cannot recognize Nova's full-page create or update
|
|
form markup.
|
|
|
|
## License
|
|
|
|
Nova Form Dock is open-source software licensed under the MIT license.
|