norman-huth / nova-assets-changer
Change Nova resources
Package info
github.com/Muetze42/nova-assets-changer
Language:Vue
pkg:composer/norman-huth/nova-assets-changer
Requires
- laravel/nova: ^5.0
Requires (Dev)
None
Suggests
None
Provides
None
Conflicts
None
Replaces
None
README
This repository is archived and no longer maintained.
If you offer, maintain, or know of an actively maintained alternative to this project, please contact me at maintainers@huth.it.
If the alternative references this repository as its source, inspiration, predecessor, or migration path, I may list it here so existing users can find a maintained replacement.
Nova Assets Changer
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.
IMPORTANT
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
Install
composer require norman-huth/nova-assets-changer --dev
Running
For the full process run this command:
php artisan nova:custom-assets
Optional
Run Command Only If A Nova Update Is Detected (Or The Package Has No Version Saved)
php artisan custom-assets:after-composer-update
Publish Nova Assets Via Command
php artisan custom-assets:publish
Publish Nova Field Assets Via Command (experimental)
php artisan custom-assets:publish:field
Notice
After a Nova update, you need to check your resource files to see if they are still compatible.
Examples
I make not a release for every example. For all example resources take a look in the resources folder of the GitHub
repository.
⚠️ These files are all based on one of the first Nova 4 releases and serve only as an example! ⚠️
Other Composer Or NPM Command
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'; }
Add Custom CSS
Create resources/Nova/custom.css with Your custom CSS.
Register new pages
Example: Register Page