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

Laravel Permission Mongodb Laravel Package

mostafamaklad/laravel-permission-mongodb

Manage roles and permissions in Laravel with MongoDB. This package offers a MongoDB-backed implementation of familiar Laravel permission features, letting you assign roles, permissions, and direct user permissions through Eloquent-style APIs.

View on GitHub
Deep Wiki
Context7

Getting Started

This assessment is for the v5.0.0-alpha release. The release notes are intentionally terse — PHP 8.0 support and updated model relations — so treat the upgrade guide and composer.json as the source of truth before adopting.

  1. Confirm requirements first. Open the package’s composer.json and check the new constraints: PHP (^8.0?), illuminate/* / laravel/framework ranges, and any newly required extensions. The “PHP 8.0 support” note may mean PHP 7.x was dropped, which is a breaking change for older CI images.
  2. Pin the pre-release explicitly. Because this is an alpha, install with an exact constraint rather than ^5.0:
    composer require vendor/package:5.0.0-alpha --with-all-dependencies
    
    Replace vendor/package with the actual package name. Commit the lockfile.
  3. Look here first, in order:
    • CHANGELOG.md / GitHub release for v5.0.0-alpha
    • UPGRADING.md or migration notes for the relation changes
    • The package’s test suite around models/relations
    • config/ defaults and any publishable migrations
  4. First use case: install into a throwaway Laravel app on PHP 8.0, publish config/migrations if the package provides them, then exercise one or two of the updated relations with an eager-loaded query. Compare the results against the v4 output before touching application code.

Implementation Patterns

  • Start read-only. In a branch, run the package’s own tests and a small smoke test that touches the changed relations (with(), load(), whereHas(), pivot access). Only then migrate write paths.
  • Use a fresh-app sandbox. Create a minimal Laravel 9/10-on-PHP-8.0 app and install only this package. It isolates relation regressions from your application’s own model customizations.
  • Wrap relation-dependent code in regression tests. The release note “Update Relations between models” is the highest-risk item. Add tests for:
    • relation method names and return types
    • eager-loading behavior and N+1 counts
    • pivot/through relations if the package uses them
    • serialization (toArray() / API resources) of related models
  • Keep the old major available. If you cannot isolate the alpha, maintain both versions behind a Composer branch alias or a separate service provider so you can compare behavior side by side.
  • Eager-load deliberately. If the package exposes Eloquent relations, use with() in list endpoints and enable Model::preventLazyLoading() in non-production to catch accidental lazy loads introduced by relation changes.
  • Run your CI matrix on PHP 8.0+. Add 8.0 (and any later versions the package claims) to the matrix before merging. This is the cheapest way to catch the PHP-version implications of the release.
  • Automate the upgrade check. Add a Composer script or CI job that runs composer why-not vendor/package 5.0.0-alpha to surface conflicting Laravel/framework constraints early.

Gotchas and Tips

  • This is an alpha. Do not assume backward compatibility, and do not use ^5.0 until a stable v5 is published. Pin 5.0.0-alpha exactly and expect breaking changes between alphas.
  • “PHP 8.0 support” is ambiguous. It may mean PHP 8.0 was added while 7.x remains supported, or that 7.x was dropped in this major. Check the composer.json require block — do not infer from the note.
  • Relation changes are the main risk. “Update Relations between models” could mean renamed methods, changed return types, altered pivot columns, or different default eager-loading. Diff the package’s model classes against v4 and grep your codebase for every affected relation name.
  • Publishable assets may have changed. Re-publish config and migrations in the sandbox and diff them; silently changed defaults are a common source of subtle bugs. Never overwrite production config blindly.
  • Debugging checklist if relations misbehave:
    • composer show vendor/package to confirm the installed version
    • php artisan about to confirm PHP and Laravel versions
    • Model::preventLazyLoading() and query logging to inspect generated SQL
    • the package’s own test suite run in isolation
  • Extension points to check before forking: custom relation classes, model macros, config-driven table/column names, and any service-container bindings. If the relation update changed these, prefer configuration over patching vendor code.
  • Rollback plan. Because this is a pre-release of a major version, keep the v4 lockfile and a revert commit ready. Test the downgrade path as well as the upgrade path.

Overall: the release is worth tracking, but the notes are too sparse to justify production adoption. Validate the PHP constraint change and relation behavior in a sandbox and test suite first; treat v5.0.0-alpha as an evaluation target, not a day-to-day dependency.

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