Weave Code
Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message

News Bundle Laravel Package

rz/news-bundle

rz/news-bundle is a lightweight PHP package for adding news and article management to your application. It offers a simple structure for storing, listing, and displaying news posts, with Composer installation and framework-friendly configuration.

View on GitHub
Deep Wiki
Context7

Getting Started

Confirm what this is before you spend a minute on it. rz/news-bundle is a Symfony bundle — not a Laravel package. There is no NewsServiceProvider, no facade, no extra.laravel block, no illuminate/* constraint, and no php artisan vendor:publish path. It is also archived, with zero stars and zero dependents. So "getting started" for a Laravel developer means reading it as reference material, not composer require-ing it.

Minimal steps:

  1. Clone the repo and open composer.json. Verify the actual composer name — the repo is rzproject/NewsBundle but the package may be published as rz/news-bundle. Also read the require block: if you see symfony/framework-bundle, doctrine/orm, or sonata-project/*, that tells you exactly how much is Doctrine/Symfony-coupled versus plain PHP.
  2. Check the license file. If you plan to copy entity or repository code into your app (the only sane use), the license has to permit it and you need to record provenance.
  3. Look first at Entity/, then Repository/, then Resources/config/ and DependencyInjection/. In RZ/News-style bundles the entity is the product — the schema and field names are the reusable artifact. Everything under Resources/ is Symfony wiring you will throw away.
  4. Note what's absent: no test suite worth trusting, no migrations directory you can rely on, no documented API surface. Read the entity properties and Doctrine annotations directly.

First use case for a Laravel dev: translate the News (or Post/Article) Doctrine entity into an Eloquent model, generate a Laravel migration from its column definitions, and add a published() scope based on whatever date/flag columns the entity exposes. That's a two-hour exercise that gives you a defensible schema and a working model, with zero dependency on archived code.

If you are genuinely on Symfony, the steps are: require it, register Rz\NewsBundle\RzNewsBundle::class => ['all' => true] in config/bundles.php, confirm Doctrine ORM is installed (the bundle does nothing without it), then generate a migration from the mapping and expose a trivial listing controller.

Implementation Patterns

Port, don't depend. The only production-safe pattern is copy-and-own. Pull Entity/ and Repository/ into your own namespace, strip the Doctrine annotations, and rewrite as Eloquent. You inherit the schema design and lose the dead dependency.

Entity field → Eloquent cast mapping. This is the mechanical part of the port:

Doctrine Eloquent
@ORM\Column(type="string") $casts not needed, plain string
@ORM\Column(type="datetime") 'published_at' => 'datetime'
@ORM\Column(type="json_array") 'meta' => 'array'
@ORM\Column(type="boolean") 'is_published' => 'boolean'
@ORM\ManyToOne(targetEntity=Category::class) belongsTo(Category::class)
@ORM\OneToMany(...) hasMany(...)
@ORM\ManyToMany w/ join table belongsToMany(...) + a pivot migration

Repository finders → query scopes. Bundles of this vintage typically ship finders like findPublished(), findLatest(), findBySlug(). Recreate them as local scopes so controllers stay thin:

public function scopePublished($q): void
{
    $q->where('is_published', true)
      ->where('published_at', '<=', now());
}

public function scopeLatest($q): void
{
    $q->orderByDesc('published_at');
}

Lifecycle callbacks → observers. If the Doctrine entity has @ORM\HasLifecycleCallbacks (common for createdAt/updatedAt or slug generation), that maps to Eloquent booted() hooks or an observer, not to model events copied verbatim.

Admin surface: skip Sonata entirely. If the bundle ships Sonata admin classes, they assume SonataAdminBundle plus its block/asset stack — a heavyweight dependency you do not want to recreate. On Laravel, reimplement the CRUD as a Filament resource or Nova resource against your ported model. The admin class is useful only as a checklist of which fields are editable and which are read-only.

Routing and templates → Laravel-native. The bundle's Resources/config/routing.* and Twig templates become routes/web.php entries and Blade views. Don't try to interpret the Symfony route definitions; just note the URL shape (/news, /news/{slug}) and slug-based lookup, which is the one design decision worth carrying over.

Adapter pattern if you're stuck in a mixed stack. If you genuinely have a Symfony service consuming the bundle's repository alongside Laravel code, wrap it behind a small interface (NewsReader::latestPublished(int $limit): Collection) implemented by an adapter. When you finish the Eloquent rewrite, it's a one-class swap instead of a hunt for call sites.

Use it as a requirements checklist. The fields, relations, and finders the bundle bothered to implement are a decent proxy for "what a news module needs at minimum": title, slug, body, author, category, publish flag, publish date, timestamps. That list scopes your internal build faster than a blank-page design session.

Gotchas and Tips

  • Archived means frozen. No PHP 8.2+/8.3 compatibility work, no Doctrine 3 support, no security patches. Anything you pin becomes your team's problem on the next framework upgrade. This alone rules out production dependency.
  • Composer name ambiguity. Repo rzproject/NewsBundle vs. package rz/news-bundle — RZ bundles have shifted naming over the years. Confirm from composer.json before attempting an install, or you'll chase a package that 404s.
  • Doctrine annotations are not attributes. If the code predates PHP 8 attribute migration, the mapping is in docblocks. Copying those docblocks into a Laravel model does nothing and will confuse the next reader — convert to $casts and $fillable, and delete the annotations.
  • ResolveTargetEntityListener inheritance won't survive the port. RZ bundles often expect you to subclass the base entity and point Doctrine at your class. Eloquent has no equivalent; use single-table inheritance with a type column or separate models.
  • Bundle registration fails silently (Symfony context). Forget config/bundles.php and nothing errors until you reference a service. Debug with bin/console debug:container | grep -i news.
  • Configuration.php trees often have required nodes with no defaults. Missing YAML keys throw at container compile time, not at runtime, which makes them look like unrelated failures. Read the configuration tree before guessing.
  • No Laravel auto-discovery, and don't build a shim. Writing a service provider to bootstrap a Symfony bundle's container inside Laravel is a multi-day detour with no payoff. If you need the code, copy the code.
  • Extension points are limited to template/entity overrides. For Symfony users, template overrides go under templates/bundles/RzNewsBundle/ and entity overrides go through the resolve-target mechanism — never edit vendor/. For Laravel users this is moot; you own the ported code outright.
  • License and provenance before copying. If you lift the entity and repository into your app, note the source, version, and license in the file header or a NOTICE file. It's archived third-party code living in your repo now.
  • Don't treat the "opportunity" score as a quality signal. It reflects an unfilled niche, not a usable artifact. The correct read: news/content is a recurring packaged problem, and this instance of it is not the answer.
Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
microsoft/fluentui-system-icons
mmccook/php-json-canonicalization-scheme
middlewares/firewall
qubiqx/montapacking
nyoncode/laravel-package-console
pnscripts/filament-broadquill-lite
pnscripts/laravel-sentfold-lite
vleap/mx-sdk-laravel-internal
twidpay/utils
htetmyathlaing/scout-elasticsearch-driver
artisan-toolbox/front-awesome
ls/client-assistant
users-au/laravel-client
cgv/localized-resource
noith/settings
kda/laravel-package
kda/filament-dynamic-navigation
bypersoft/signbox
pairus/product-data
fayne/laravel-filament-cms-core