den1n / nova-pages
Laravel Nova static pages resource.
This package's canonical repository appears to be gone and the package has been frozen as a result.
Requires
- php: >=7.3
- laravel/scout: ^v8.0|^v9.0
This package is auto-updated.
Last update: 2023-08-24 12:51:13 UTC
README
Static pages resource for Laravel Nova.
Installation
Install package with Composer.
composer require den1n/nova-pages
Publish package resources.
php artisan vendor:publish --provider="Den1n\NovaPages\ServiceProvider"
This will publish the following resources:
- Configuration file
config/nova-pages.php
- Migration file
database/migrations/*_create_pages_tables.php
- Translations
resources/lang/vendor/nova-pages
Migrate database.
php artisan migrate
Add instance of class Den1n\NovaPages\Tool
to your App\Providers\NovaServiceProvider::tools()
method to display the pages within your Nova resources.
/** * Get the tools that should be listed in the Nova sidebar. * * @return array */ public function tools() { return [ new \Den1n\NovaPages\Tool, ]; }
After that Pages
resource will be available in navigation panel of Nova.
Page types
By default all pages will has default
type.
You can register additional types in configuration file config/nova-pages.php
.
/** * Page types. */ 'types' => [ // ... [ 'name' => 'my_type', 'description' => 'My Type', ], ],
After that new type will be available to select when creating page or updating existing one.
WYSIWYG editor
By default package uses default WYSIWYG editor provided by Nova.
You can replace default editor. For example, with froala/nova-froala-field
.
To do this, install the package and update editor
settings in config/nova-pages.php
file.
/** * Settings for WYSIWYG editor. */ 'editor' => [ /** * Nova field class name. */ 'class' => \Froala\NovaFroalaField\Froala::class, /** * Options which will be applied to te field instance. * Key: name of field method. * Value: list of method arguments. */ 'options' => [ 'withFiles' => ['public', 'nova-pages'], // Froala options. 'options' => [[ 'heightMax' => 800, 'heightMin' => 300, ]], ], ],
Screenshots
Pages
Page Form
Page Details
Contributing
- Fork it.
- Create your feature branch:
git checkout -b my-new-feature
. - Commit your changes:
git commit -am 'Add some feature'
. - Push to the branch:
git push origin my-new-feature
. - Submit a pull request.
Support
If you require any support open an issue on this repository.
License
MIT