This package is for Nova 4 and swaps the resources from the resources/Nova/Nova
folder with those in
the vendor/laravel/nova/resources/js
folder or use the php artisan custom-assets:publish
command.
Then the assets are recompiled and published with the Force option.
This package creates a backup of each file and checks for changes
Attention. The original vendor files will be overwritten.
You must run the php artisan nova:custom-assets
after every composer update!
Tip: You can replace @php artisan nova:publish
with @php artisan custom-assets:after-composer-update
in
Your composer.json
composer require norman-huth/nova-assets-changer --dev
For the full process run this command:
php artisan nova:custom-assets
php artisan custom-assets:after-composer-update
php artisan custom-assets:publish
php artisan custom-assets:publish:field
After a Nova update, you need to check your resource files to see if they are still compatible.
I make not a release for every example. For all example resources take a look in the resources
folder of the GitHub
repository.
Create a command:
php artisan make:command CustomAssetsCommand
with followingen content:
<?php
namespace App\Console\Commands;
use NormanHuth\NovaAssetsChanger\Console\Commands\CustomAssetsCommand as Command;
class CustomAssetsCommand extends Command
{
/**
* CLI Composer Command
*
* @var string
*/
protected string $composerCommand = 'composer';
/**
* CLI NPM Command
*
* @var string
*/
protected string $npmCommand = 'npm';
}
Create resources/Nova/custom.css
with Your custom CSS.
Example: Register Page