webid / cms-nova
CMS for Laravel with Nova
Requires
- php: ^8.2
- alexwenzel/nova-dependency-container: ^1.10
- eminiarts/nova-tabs: ^2.2
- interaction-design-foundation/nova-html-card: ^3.1
- laravel/framework: ^9|^10
- laravel/nova: ~4.0
- nwidart/laravel-modules: 9.*
- oneduo/nova-file-manager: ^0.12.0
- spatie/laravel-honeypot: ^4.3
- spatie/laravel-sitemap: ^6.2
- spatie/laravel-translatable: ^6.2
- whitecube/nova-flexible-content: ^1.0
Requires (Dev)
- barryvdh/laravel-ide-helper: ^2.13
- enlightn/security-checker: ^1.10
- khaled-dev/nova-assertions: ^1.2
- laravel/pint: ^1.0
- nunomaduro/larastan: ^1.0.2
- orchestra/testbench: ^7.4
- phparkitect/phparkitect: ^0.3.25
- phpunit/phpunit: ^9.5.10
- squizlabs/php_codesniffer: ^3.5
This package is auto-updated.
Last update: 2024-10-11 11:59:36 UTC
README
Table of contents
Requirements
- PHP >= 8.2
- Laravel >= 9
- Nova >= 4
- Composer 2
- MariaDB / MySQL
Installation
1. Install the package
This package can be installed as a Composer dependency.
"repositories": [ { "type": "vcs", "url" : "git@github.com:web-id-fr/cms-nova.git" } ]
composer require webid/cms-nova
2. Publish files
Case 1 : First install
php artisan vendor:publish --provider="Webid\CmsNova\CmsServiceProvider" --force
Case 2 : Second install (or after)
php artisan vendor:publish --provider="Webid\CmsNova\CmsServiceProvider"
3. Install databases
make install_db
4. Add nova-components in composer
"extra": { "laravel": { "dont-discover": [], "providers": [ "Webid\\ComponentTool\\ToolServiceProvider" ] } }
"autoload": { "psr-4": { "Webid\\ComponentTool\\" : "nova-components/ComponentTool/src/" }, },
"require": { "webid/component-item-field": "*", }, "repositories": [ { "type": "path", "url": "./nova-components/ComponentItemField" } ]
Then run composer update
5. Prepare routes
You have to remove all routes from your routes/web.php
file to make sure
the cms will work properly.
If the project is a fresh Laravel project, you may have some generated code like this to remove :
Route::get('/', function () { return view('welcome'); });
6. Link storage files
Run command php artisan storage:link
.
7. Configure sitemap.xml
If you want to allow robots to access your sitemap, add this line in the robots.txt
file :
Sitemap: https://www.your-domain.com/sitemap.xml
⚠ Replace www.your-domain.com
by your actual website domain.
⚠ ⚠ Do not delete existing code in nova-components !!! ⚠ ⚠
Customization
Disable robots follow
To disable the tracking of robots, you must add in the .env DISABLE_ROBOTS_FOLLOW=true
Use form
js
do not modify the file send_form.js
!
Edit the helper.js
file with the form front information to display errors and the success message.
Added to package.json
:
"dropzone": "^5.7.0", "lang.js": "^1.1.14"
In the webpack.mix
file, add the send_form_js
file. The file is already linked in the front.
front-end
You can change the form frontend but DO NOT TOUCH the submit_form
class for sending forms.
Internationalization
Don't forget to create a service to display the languages as you need them. Use this service into a ViewServiceProvider to share both languages and translated slugs to views.
To create the service provider, you can run :
php artisan make:provider ViewServiceProvider
⚠ Don't forget to add the service provider in the file config/app.php
.
Update email template
Template email in resources/views/mail/form.blade.php
You can change the design of the mail template but do not delete or modify the existing code! The present code allows you to display the fields of the form sent in the email.
Add images for components
public/cms/images/components/gallery_component.png public/cms/images/components/newsletter_component.png