novius / laravel-nova-news
A Laravel Nova package for news and blog posts management
Requires
- php: ^8.1
- illuminate/support: ^8.83.4|^9.3.1|^10.0
- laravel/nova: ^4.0
- novius/laravel-nova-field-preview: ^1.0.0
- novius/laravel-nova-publishable: ^2.0.0
- novius/laravel-nova-translatable: ^0.0.5
- spatie/laravel-sluggable: ^3.4
- waynestate/nova-ckeditor4-field: ^1.1
Requires (Dev)
- laravel/pint: ^1.10
- orchestra/testbench: ^8.5
- pestphp/pest: ^2.8
README
Introduction
This Laravel Nova package allows you to manage Post news in your Laravel Nova admin panel.
You will be able to create posts, categories and tags.
You can attach multiple categories and tags to a post. Categories can be viewed as a listing page.
Requirements
- Laravel Nova >= 4.0
- Laravel >= 8.0
Installation
You can install the package via composer:
composer require novius/laravel-nova-news
Register the tool in the tools
method of the NovaServiceProvider
:
// app/Providers/NovaServiceProvider.php public function tools() { return [ // ... new \Novius\LaravelNovaNews\LaravelNovaNews(), ]; }
Run migrations with:
php artisan migrate
Configuration
You can optionally publish the config file with:
php artisan vendor:publish --provider="Novius\LaravelNovaNews\LaravelNovaNewsServiceProvider" --tag="config"
This will allow you to override the resource class for example.
// config/laravel-nova-news.php return [ // ... 'resources' => [ 'post' => \App\Nova\Post::class, ], ];
// app/Nova/Post.php namespace App\Nova; use Laravel\Nova\Fields\Text; class Post extends \Novius\LaravelNovaNews\Nova\NewsPost { public function mainFields(): array { return [ ...parent::mainFields(), Text::make('Subtitle'), ]; } }
Assets
Next we need to publish the Laravel Nova Translatable package's assets. We do this by running the following command:
php artisan vendor:publish --provider="Novius\LaravelNovaTranslatable\LaravelNovaTranslatableServiceProvider" --tag="public"
Migrations and lang files
If you want to customize the migrations or lang files, you can publish them with:
php artisan vendor:publish --provider="Novius\LaravelNovaNews\LaravelNovaNewsServiceProvider" --tag="migrations"
php artisan vendor:publish --provider="Novius\LaravelNovaNews\LaravelNovaNewsServiceProvider" --tag="lang"
Testing
Run the tests with:
composer test
Lint
Lint your code with Laravel Pint using:
composer lint
Licence
This package is under GNU Affero General Public License v3 or (at your option) any later version.