This Laravel tutorial helps to understand nova logs. I’ll let you know how to install nova and configure nova logs. Laravel Nova is a commercial admin panel package that provides a range of tools for building web applications on Laravel.
Laravel Nova
The premium administrative panel for the Laravel PHP framework is called Laravel Nova. This can be simply integrated into any Laravel application and offers a straightforward, user-friendly interface for managing resources like users, roles, and permissions.
It helps developers can quickly build custom administration panels for their applications without having to write a lot of repetitive code. It comes with a variety of built-in tools and features:
- A powerful CRUD (create, read, update, delete) interface for managing resources
- Advanced filtering and searching capabilities
- Resource metrics and trends tracking
- Built-in support for actions and batch processing
- Automated form validation and error handling
- Integration with Laravel’s authorization and authentication systems.
The pre-requistes:
- Nova admin
- Nova Logs
- php: ^7.4 | ^8
How To Install Nova
Let’s install nova premium administrative panel for the Laravel PHP framework.
Laravel Nova has a few requirements you should be aware of before installing:
- Composer
- Laravel Framework 8.0+
- Laravel Mix 6
- Node.js (Version 14)
- NPM
Nova 4 installation is always performed via Composer. You may install Nova as a Composer package via the composer.json
file:
"repositories": [ { "type": "composer", "url": "https://nova.laravel.com" } ],
After updating composer.json
file, You need to run the composer update command in your console terminal:
composer update --prefer-dist
Once, You run the composer update, you will be prompted to provide a username and password. You need to use your Nova website email as username and a license key as a password.
Let’s run the nova:install
and migrate Artisan commands :
php artisan nova:install php artisan migrate
Please make sure to check whether the App\Providers\NovaServiceProvider has been included in the providers array of your application configuration file after executing the given command.
Note: Nova requires a license key and a production URL to be used in production environments.
How To Install Nova Logs
You can install the package into a Laravel app that uses Nova via composer:
composer require php-junior/nova-logs
it is important to note that it only supports the daily log channel. Therefore, you need to ensure that your .env file specifies the LOG_CHANNEL
as daily instead of stack.
If you are using Laravel 5.5 or an earlier version, add the following line to your .env
file:
APP_LOG=daily
Once this is done, you will need to register the LogViewer tool with Nova. Typically, this is achieved by adding the necessary code to the tools method of the NovaServiceProvider
.
// in app/Providers/NovaServiceProvider.php public function tools() { return [ // ... new \PhpJunior\NovaLogViewer\Tool(), ]; }
To publish the configuration use:
php artisan vendor:publish --tag=nova-logs-config
Conclusion
Nova and NovaLog offer a powerful set of tools for Laravel development, but proper configuration is crucial for full functionality. Correct settings in .env and proper tool registration are key to streamlining workflows and debugging issues, saving time and effort.