fuelviews / laravel-sabhero-article
Sabhero article package
Requires
- php: ^8.3||^8.2
- ext-zip: *
- diglactic/laravel-breadcrumbs: ^10.0||^9.0
- embed/embed: ^4.4
- filament/spatie-laravel-media-library-plugin: ^3.2
- filament/support: ^3.2
- fuelviews/laravel-sabhero-wrapper: ^0.0
- illuminate/contracts: ^10.0||^11.0||^12.0
- spatie/filament-markdown-editor: ^2.0
- spatie/laravel-feed: ^4.4
- spatie/laravel-package-tools: ^1.19
Requires (Dev)
- driftingly/rector-laravel: ^2.0
- laravel/pint: ^1.14
- nunomaduro/collision: ^8.1.1||^7.10.0
- orchestra/testbench: ^10.2||^9.0.0||^8.22.0
- pestphp/pest: ^3.0||^2.34
- pestphp/pest-plugin-arch: ^3.0||^2.7
- pestphp/pest-plugin-laravel: ^3.2||^2.3
- rector/rector: ^2.0
README
A full-featured article management solution for Laravel applications with Filament admin panel integration. This package provides a complete article publishing platform with advanced features and an intuitive admin interface.
Features
- Complete Article Management: Posts, categories, tags, and authors
- Scheduled Publishing: Schedule posts to be published automatically
- Blade Components: Ready-to-use UI components including cards, feature cards, and breadcrumbs
- Advanced Content: Markdown rendering with automatic table of contents
- Media Management: Image uploads with responsive images support
- SEO Optimization: Built-in SEO metadata for better search rankings
- RSS Feed: Automatic feed generation with customizable settings
- Tailwind Pagination: Custom pagination views for Tailwind CSS
- Filament Integration: Full admin panel for managing all article content
Installation
Prerequisites
This package requires Filament. If your project doesn't have Filament yet:
composer require filament/filament:"^3.2" -W
php artisan filament:install --panels
Create a Filament User
php artisan make:filament-user
Install the SabHero Article Package
composer require fuelviews/laravel-sabhero-article
Configuration
1. Publish Configuration Files
php artisan vendor:publish --tag="sabhero-article-config"
2. Publish Migrations
php artisan vendor:publish --tag="sabhero-article-migrations"
3. Run Migrations
php artisan migrate
Integration
1. Attach to Filament Panel
Add the SabHero Article plugin to your Filament panel provider:
use Fuelviews\SabHeroArticle\Facades\SabHeroArticle; public function panel(Panel $panel): Panel { return $panel ->plugins([ SabHeroArticle::make() ]); }
2. Add Traits and CanAccessPanel to User Model
Your user model needs to be setup to use the HasArticle
trait and ensure the required fields are in the fillable array:
use Filament\Models\Contracts\FilamentUser; use Filament\Panel; use Fuelviews\SabHeroArticle\Traits\HasArticle; use Illuminate\Database\Eloquent\Factories\HasFactory; use Illuminate\Foundation\Auth\User as Authenticatable; use Illuminate\Notifications\Notifiable; class User extends Authenticatable implements FilamentUser { use HasFactory, Notifiable, HasArticle; protected $fillable = [ 'name', 'email', 'password', 'slug', 'bio', 'links', 'is_author', ]; protected $casts = [ 'email_verified_at' => 'datetime', 'password' => 'hashed', 'links' => 'array', 'is_author' => 'boolean', ]; public function canAccessPanel(Panel $panel): bool { $allowedDomains = config('sabhero-article.user.allowed_domains', []); foreach ($allowedDomains as $domain) { if (str_ends_with($this->email, $domain)) { return true; } } return false; } }
Available Components
SabHero Article comes with several Blade components for easy UI implementation:
<x-sabhero-article::layout>
- Main article layout<x-sabhero-article::card>
- Article post-card<x-sabhero-article::feature-card>
- Featured post-card<x-sabhero-article::breadcrumb>
- Breadcrumb navigation<x-sabhero-article::header-category>
- Category header<x-sabhero-article::header-metro>
- Metro-style header<x-sabhero-article::markdown>
- Markdown content renderer<x-sabhero-article::recent-post>
- Recent posts display
Testing
composer test
Changelog
Please see CHANGELOG for more information on recent changes.
Contributing
Please see CONTRIBUTING for contribution guidelines.
Security Vulnerabilities
Please review our security policy on how to report security vulnerabilities.
Credits
License
The MIT License (MIT). Please see License File for more information.