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
Livewire Access

Livewire Access Laravel Package

leanadmin/livewire-access

LeanAdmin Livewire Access adds Laravel-style authorization to Livewire components, making it easy to gate actions and UI with policies and gates. Protect sensitive admin screens and keep access checks close to the interactions they guard.

View on GitHub
Deep Wiki
Context7

Control frontend access to properties/methods in Livewire using PHP 8 attributes.

Frequently asked questions about Livewire Access
How do I install leanadmin/livewire-access in a Laravel app?
Install it with Composer using composer require leanadmin/livewire-access, then confirm that your Laravel, PHP, and Livewire versions satisfy the package's Composer constraints. Laravel package auto-discovery should register the service provider; check the README for any required configuration or publishing steps. Because the package is pre-1.0, pin a specific version in production rather than using a floating constraint.
Does livewire-access support Laravel 10?
Yes. Release v0.1.3 adds Laravel 10 support, so Laravel 10 applications using Livewire can evaluate it. You should still verify the exact PHP and Livewire version constraints in the package's composer.json before scheduling an upgrade. Also confirm whether Laravel 9 remains supported in the same release line.
Can I use livewire-access with Laravel 8?
No, v0.1.3 removes Laravel 8 support, so Laravel 8 applications cannot adopt that release directly. You can either stay pinned to v0.1.2 or complete a Laravel upgrade before moving to v0.1.3. Treat the Laravel 8 removal as a hard dependency-review gate for legacy applications.
How do I protect a Livewire component with a role or permission?
Declare who may use the component using the package's attributes or a simple access property instead of scattering checks through every mount method. The package then enforces that declaration consistently and integrates with Laravel gates, policies, roles, and permissions. See the README for the exact attribute or property syntax supported by your pinned version.
Does livewire-access work with Laravel gates and policies?
Yes. The package is designed to apply Laravel-native authorization patterns, including gates and policies, to Livewire component access. That lets you keep authorization rules in familiar Laravel locations while enforcing them at the component boundary. Always test both allowed and denied paths because authorization behavior is security-sensitive.
How do I hide UI elements based on Livewire component access?
Livewire Access provides Blade directives and helpers for conditional rendering, so you can hide buttons, links, or sections when a user lacks access. Use these for presentation only and keep server-side enforcement on the component itself. Hiding UI must never be treated as the actual security control.
Can livewire-access redirect guests or unauthorized users instead of returning a 403?
Yes. The package supports middleware-style redirects for guests and unauthorized users, alongside returning 403 responses or hiding components as configured. This helps match existing Laravel authentication flows, such as sending guests to a login page. Confirm the exact configuration options for your pinned version in the README.
How should I test Livewire component authorization with this package?
Write tests for allowed access, denied access, guest redirects, and missing gate or policy definitions, not just the happy path. Use Laravel and Livewire testing helpers to assert 403 responses, redirects, or hidden component output as appropriate. Because authorization is security-sensitive, include negative-path tests in CI for every guarded component.
Is leanadmin/livewire-access production-ready if it is pre-1.0?
The package is at v0.1.x, so breaking changes should be expected and production use requires deliberate version pinning. Its runtime footprint is low, but authorization correctness and support-matrix changes need an internal owner and release monitoring. Avoid floating Composer constraints and keep a known-good previous version available for rollback.
Do I need livewire-access if I already use Laravel policies directly in Livewire components?
Not necessarily. You can call Laravel gates and policies directly inside each Livewire component, but you must remember to enforce them consistently in every guarded path. Livewire Access centralizes declarative component access, redirects, 403 handling, and Blade rendering helpers. It is most useful when you want those checks kept close to the component and applied uniformly across a Livewire-heavy application.
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.
users-au/socialite-provider
twidpay/twid-logger
mrnewport/laravel-plaid
mrnewport/laravel-repo
mrnewport/laravel-docsign
mrnewport/laravel-stow
mrnewport/laravel-flow
mrnewport/laravel-priceable
mrnewport/laravel-nestedterms
fredmeng/laravel-apidoc-generator
itstructure/laravel-multilingual-tools
pdustdar/elasticsearch
markupai/php-sdk
rlacerda83/lumem-microservice-shipment
uni-method/symfony-lib
tacticmedia/scim-server-bundle
neika-ai/symfony-bundle
mattleads/agent-publishing-bundle
glavweb/framework-bundle
glavweb/extra-bundle