- What Laravel and Filament versions does this package support?
- This package requires Laravel 11+ and Filament 4+. It’s optimized for modern Laravel features like model binding and validation, so ensure your project meets these requirements before installation. If you’re using Filament 3 or earlier, you’ll need to upgrade first, which may introduce breaking changes.
- How do I install and set up the package in my Laravel project?
- Run `composer require novius/laravel-filament-news`, then execute `php artisan migrate` to set up the database tables. Finally, register the `NewsPlugin` in your `AdminFilamentPanelProvider` under the `plugins` array. The package includes optional config publishing for customization via `php artisan vendor:publish`.
- Can I customize the routes, models, or resources used by this package?
- Yes, the package provides a config file (`config/laravel-filament-news.php`) where you can override default resources (e.g., `PostResource`, `CategoryResource`) and models. You can also rename routes or restrict locales. Publishing the config with `php artisan vendor:publish` makes these options available.
- Does this package include frontend templates for displaying news publicly?
- No, this package is backend-focused and provides Filament admin resources for managing posts, categories, and tags. You’ll need to build custom Blade views (e.g., in `resources/views/news/`) or integrate with frontend frameworks like Livewire or Inertia. The `publish-front` command generates a starter `NewsController` and routes to help kickstart your frontend.
- What if my project already has `posts`, `categories`, or `tags` tables? Will there be conflicts?
- Yes, conflicts may arise if your database already uses those table names. The package allows you to override the default models and resources in the config file, or you can rename the tables via custom migrations. Check the `models` and `resources` arrays in the config to map to your existing schema.
- How can I extend the package to add custom fields like `featured_image` or `publish_date`?
- You can extend the default resources by creating custom versions of `PostResource`, `CategoryResource`, or `TagResource`. For example, override `PostResource` in your config and add fields like `featured_image` using Filament’s field system. The package leverages Filament’s hooks and resource system for deep customization.
- Is this package suitable for high-traffic news sections (e.g., 10K+ monthly views)?
- The package itself is optimized for backend management, but you’ll need to implement caching strategies (e.g., Redis, database indexing) for public-facing content. For high traffic, consider adding API endpoints (REST/GraphQL) to serve content efficiently and pair it with a CDN or caching layer like Laravel’s `cache` helper or Vapor.
- What are the licensing implications of using this AGPL v3 package?
- The AGPL v3 license requires you to open-source your project if you modify and distribute the package. If this isn’t feasible, you’ll need to fork the package and relicense it. Review the license terms carefully, especially if your project includes proprietary components or if you plan to integrate the package into a closed-source application.
- Can I integrate this package with third-party services like media libraries or analytics tools?
- Yes, the package is designed for extensibility. You can integrate third-party services by overriding the default resources and adding custom logic. For example, use Filament’s `afterCreate` or `afterSave` hooks to interact with media libraries (e.g., Spatie Media Library) or analytics tools (e.g., Google Analytics). The package’s modular config also supports custom route bindings.
- Are there alternatives to this package for managing news in Laravel with Filament?
- Alternatives include `spatie/laravel-newsletter` (for newsletters) or building a custom Filament resource from scratch. However, this package is tailored specifically for Filament 4 and Laravel 11+, offering pre-built resources for posts, categories, and tags with minimal boilerplate. If you need multi-language support or advanced workflows, consider combining it with Spatie’s localization packages.