clevyr / nova-blog
A Laravel Nova tool.
Installs: 14 297
Dependents: 0
Suggesters: 0
Security: 0
Stars: 1
Watchers: 6
Forks: 0
Open Issues: 2
Requires
- php: >=7.1.0
- emilianotisato/nova-tinymce: ^2.0
- eminiarts/nova-tabs: ^2.0
- spatie/laravel-feed: ^4.1
- spatie/laravel-tags: ^4.3
- spatie/nova-tags-field: ^4.0
README
Features
- Title
- Author
- Snippet
- Locales
- Customizable slug
- Featured posts
- Customizable published-at dates
- "Published" or "draft" status
- RTE content (TinyMCE)
- Featured image for posts
- Categories
- Tags (separate from Categories)
- Custom SEO information (title, description and image)
Requirements
Vue 3
Laravel 8+
Nova 3.0+
Installation
Install the package
composer require clevyr/nova-blog
Publish Files
php artisan vendor:publish --tag=clevyr-nova-blog
php artisan vendor:publish --provider="Emilianotisato\NovaTinyMCE\FieldServiceProvider"
Run Migrations
php artisan migrate
Config
Blog Post Settings
nova-blog.php
Tag & Category Settings
tags.php
Reference 3rd party package - https://github.com/spatie/nova-tags-field
Accessing Data
Via Routes
Fetch all published posts
Route: $base_uri/get-published-posts
Example: /blog/get-published-posts
Returns: JSON of all published blog posts
Fetch individual post
Route: $base_uri/$post_uri/{post_slug}
Example: /blog/post/my-blog-post
Returns: Eloquent object of Post model
Fetch all published posts with a certain tag or category applied
Route: $base_uri/filter?type={category or tag name}
Example: /blog/filter?type=tag1
Returns: Array of Eloquent objects of Post model
Setting Default Images
To set default images for posts, featured images or seo images, you can create a new migration to change the default value.
Schema::table(config('nova-blog.blog_posts_table'), function (Blueprint $table) {
$table->string('featured_image')->default('/path-to-image')->change();
});