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

Wodel Laravel Package

quentingab/wodel

quentingab/wodel is a Composer-installable Laravel/PHP package from quentingab. It is an early-stage project with limited adoption; consult the repository README for installation, configuration, and usage details before adding it to production. Best suited for evaluation and experimentation.

View on GitHub
Deep Wiki
Context7

Getting Started

The v2.1 note — "relationsihip management" — is the only change signal available, and it is too thin to pin down a concrete API surface. Treat this assessment as a triage checklist for the relationship-management layer rather than a verified walkthrough of new methods. Before adopting, diff CHANGELOG.md, the UPGRADING.md (if present), and src/ between v2.0 and v2.1 to see whether anything was renamed, moved, or deprecated.

Install and orient yourself in this order:

  1. composer require <vendor>/<package>:^2.1 — pin the minor, since relationship packages frequently ship behavioural changes in minors.
  2. Publish config and migrations if the package exposes them: php artisan vendor:publish --provider="Vendor\Package\PackageServiceProvider" (check --tag=config / --tag=migrations first — dumping everything overwrites your app's own config).
  3. Read the service provider — it tells you what is bound in the container, which traits/macros are registered, and whether anything is auto-discovered via composer.json extra.laravel.
  4. Look at the package's own tests/ directory. Relationship packages almost always ship fixtures with pivot tables, polymorphic tables, and soft-deletable models; those fixtures are the fastest documentation of intended usage.

First use case to validate end-to-end: a belongsToMany with a pivot carrying extra columns, plus one morphTo. If both behave, the core of the package is sound. Run this against a real second connection or a seeded SQLite database rather than an empty schema — most relationship bugs only surface with existing rows.

Implementation Patterns

Trait-on-model, config-for-behaviour. The common shape is a trait applied to Eloquent models that adds relationship helpers, with behaviour toggled in config/<package>.php. Keep the config published and committed; reading defaults out of vendor/ at runtime is a reliable source of "works locally, breaks in CI".

Eager-load at the query, not the model. Whatever the package adds, keep the standard Laravel discipline:

$posts = Post::with(['author:id,name', 'tags' => fn ($q) => $q->where('active', 1)])
    ->paginate(25);

Constrain inside the closure rather than filtering the collection afterwards — the whole point of eager loading is to avoid hydrating rows you discard.

Pivot writes through the package, reads through Eloquent. If v2.1 adds relationship-management helpers for attach/detach/sync, use them for writes and let standard Eloquent withPivot() handle reads. Mixing both write paths in one codebase is how duplicate pivot rows appear.

Polymorphic maps in a service provider. Register Relation::enforceMorphMap([...]) in AppServiceProvider::boot() before anything else touches relations. This is the single highest-value habit with polymorphic relationships: it turns stored class names into stable aliases, so refactoring a model namespace stops corrupting historical rows. Enable Model::preventLazyLoading(! app()->isProduction()) in the same place so N+1s fail loudly in dev and tests.

Wrap multi-relationship writes in a transaction. Anything that touches a parent plus its children plus pivots:

DB::transaction(function () use ($data) {
    $post = Post::create($data);
    $post->tags()->sync($data['tag_ids']);
});

Relationship management without transactions produces orphaned pivots on partial failure, and those are tedious to reconcile later.

Form requests for sync input. Validate IDs with ['array', 'exists:tags,id'] before they reach a sync call. exists validation on the pivot target catches the most common 500 in relationship code.

Gotchas and Tips

The release note is not a changelog. "relationsiight management" tells you a feature area, not a contract. Do not assume backwards compatibility just because it is a 2.1. Check for: renamed trait methods, changed default config values, altered withPivot column sets, and new morphMap requirements. Any of these can be a silent breaking change.

Typo in the note itself is a yellow flag. Small releases with one-line notes often mean the changelog was hand-edited at tag time. Cross-reference the git history (git log v2.0..v2.1 --stat) against what the note claims.

Foreign keys and cascade behaviour. Relationship packages sometimes ship migrations with onDelete('cascade') and sometimes restrict. Check the generated migrations before running them on production data — and note that SQLite requires PRAGMA foreign_keys=ON (config/database.php for older Laravel, or it's on by default from Laravel 11) or the constraint silently does nothing in tests.

Detach vs delete. detach() removes the pivot row; delete() removes the related model. Confusing the two in a relationship-management layer is destructive and usually only noticed in production. If v2.1 introduces convenience methods here, write a test asserting the related model still exists after the call.

Soft deletes and pivot tables. Pivot tables do not get deleted_at automatically. A soft-deleted parent with cascade semantics will leave pivots dangling. Decide explicitly whether relationships to trashed models should resolve, and use withTrashed() in the eager-load closure if so.

Debugging relationships. Reach for ->toSql() plus DB::listen() before anything else; most "relationship is broken" reports are a missing whereNull('deleted_at') or a wrong foreign key. Model::preventLazyLoading() in tests converts silent N+1s into failures at the exact call site, which is far cheaper than profiling later.

Extension points worth knowing. The package's service provider bindings and any published config keys are the supported seams. Prefer rebinding in your own provider or extending the trait over editing vendor files or monkey-patching via macro(). Macros on BelongsToMany are globally scoped and will collide with other packages doing the same.

Cache invalidation. Relationship-heavy apps usually cache counts and nested collections. If v2.1 adds aggregate helpers, verify they bust cache on attach/detach — packages rarely wire this up by default, and stale counts are hard to attribute to a release.

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.
shitoudev/permissionmanager
johannesclimacus/laravel-tui
hocvt/seotools
vitalybaev/sypexgeo
amphibee/themosis-ignition
gito-me/fast-excel
frankyso/laravel-ipaymu
geolize-studio/laravel-chile
boomerangui/chat
jinas/dhivatar
store-doc/laravel-storage-driver
plus-it/laravel-translation-manager
diephp/perhaps
diephp/telegraph
osmaviation/spreadsheet
microsoft/fluentui-system-icons
mmccook/php-json-canonicalization-scheme
middlewares/firewall
qubiqx/montapacking
nyoncode/laravel-package-console