This template provide a ready to start app with the following features and technologies
-
- With these packages (see de cods of each package):
- https://github.com/laravel/nova-log-viewer
- https://github.com/Muetze42/nova-menu
- https://github.com/TitasGailius/nova-search-relations
- https://github.com/spatie/browsershot
- https://github.com/jbroadway/urlify
- https://github.com/vinkla/hashids
- https://github.com/vyuldashev/nova-permission
- https://github.com/bolechen/nova-activitylog
- With this customizations
- Nova resources on
Resources
directory and files withResource
suffix - Allow custom ordering per Nova Resource using the property
$orderBy = ['name' => 'asc'];
- Custom Menu (with search and css customization)
- Custom footer
- Helpers
- Services
- FileFromDbService (serve file loaded from DB)
- Wrapper to Browsershot
use App\Services\PdfConverter; public function __construct(public PdfConverter $pdfConverter) { } public function generatePdfFromViw() { // this will generate the pdf from a blade view and render it in the browser $this->pdfConverter ->loadView('path.to-view', [ //... data to view ]) ->inline('filename.pdf'); }
- Traits
- [UseHashId(app/Traits/UseHashId.php), for models (https://github.com/vinkla/hashids)
- DefaultModelFunctions default function to all models, like log all changes in all models
- Nova resources on
- With these packages (see de cods of each package):
-
Vue 3 with (by Laravel Breeze and InertiJs) with
-
strict_types
in all pages -
Custom
laravel pint
rules -
Language pt_BR by default
- email tracking
- multi tentant
run the following code with your e-mail and nova licence key
composer config http-basic.nova.laravel.com YOUR-NOVA-ACCOUNT-EMAIL@YOUR-DOMAIN.COM YOUR-LICENSE-KEY
update the .env
file, setting your larva nova license key:
NOVA_LICENSE_KEY=PUT_YOUR_NOVA_LICENSE_KEY_HERE
Create the following GitHub secrets
- LARAVEL_NOVA_USERNAME
- LARAVEL_NOVA4_TOKEN
And then run
composer update --prefer-dist
php artisan migrate
Create a user running
php artisan nova:user
For mor information about official Nova customization, consult the Larave Nova docs
-
By default, just superAdmin users can access nova outside environment. See docs to change dhis logic. See app/Models/User.php to change de
isSuperAdmin()
logic. -
To customize the menu, edit the files app/nova/Menus/UserMenu.php and app/nova/Menus/MainMenu.php
We use https://github.com/vyuldashev/nova-permission to manage Spatie Permission. Some customization was added to vyuldashev/nova-permission, allowing to add date limit to permission. After the end date, the permission will be automatically removed
Laravel Nova uses Policy to define if the user can access a resource. This template grant access to all resources to a user if:
- he is a
superAdmin
see isSuperAdmin() method AND - The policy return no content
The rest, folows the default Laravel Nova Authorization logic
composer test