PHPackages                             elfeffe/local-login - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Authentication &amp; Authorization](/categories/authentication)
4. /
5. elfeffe/local-login

ActiveLibrary[Authentication &amp; Authorization](/categories/authentication)

elfeffe/local-login
===================

Local-only query parameter login helper for Laravel

v1.0.1(4mo ago)010MITPHPPHP ^8.4

Since Dec 29Pushed 1mo agoCompare

[ Source](https://github.com/elfeffe/local-login)[ Packagist](https://packagist.org/packages/elfeffe/local-login)[ RSS](/packages/elfeffe-local-login/feed)WikiDiscussions main Synced 1mo ago

READMEChangelogDependencies (1)Versions (3)Used By (0)

Elfeffe Local Login (`elfeffe/local-login`)
-------------------------------------------

[](#elfeffe-local-login-elfeffelocal-login)

This package adds a **local-only** “login by URL query parameter” helper.

When enabled, any **GET/HEAD** request containing `logged` will:

- Authenticate the session as a user
- Redirect back to the same URL **without** the `logged` parameter

This is handy when debugging apps behind tunnels like Expose/Ngrok (public URL, but still running with `APP_ENV=local` on your machine).

Security (important)
--------------------

[](#security-important)

This feature is **hard disabled** outside local:

- The service provider **only registers** hooks when `app()->isLocal()`
- The middleware itself also checks `app()->isLocal()`

So even if someone appends `?logged=...` in production/staging, it does nothing.

Requirements
------------

[](#requirements)

- PHP `^8.4`
- Laravel `^13.0`
- Optional: Filament v5 (if installed, the middleware is automatically injected into all panels)

Installation
------------

[](#installation)

```
composer require elfeffe/local-login:^1.0
```

Usage
-----

[](#usage)

### Option A (generic): log in by user ID

[](#option-a-generic-log-in-by-user-id)

Append `logged=` to any URL:

- `https://your-app.test/dashboard?logged=62`
- `https://your-app.test/dashboard/some/page?tool=adder&logged=62`

The first request will return a redirect to the same URL without `logged`. Follow the redirect and you’ll be authenticated.

### Option B (Filament tenancy): `?logged` (no value)

[](#option-b-filament-tenancy-logged-no-value)

If you are using **Filament v5 with tenancy**, you can append `?logged` (without a value) to a tenant URL (where the tenant identifier / UUID is present in the route):

- `https://your-app.test/dashboard//.../import?logged`

In this mode, the middleware extracts the tenant identifier from the route (or the URL), resolves the tenant, and logs you in as:

- `created_by` (or `owner_id` / `user_id`) if present on the tenant model, otherwise
- the first related tenant user (`$tenant->users()->orderBy('users.id')->first()`) if a `users()` relationship exists.

Filament v5 compatibility
-------------------------

[](#filament-v5-compatibility)

Filament panels define their own middleware stacks, so being in Laravel’s `web` group isn’t enough.

When Filament v5 is installed, this package also:

- Injects `LoginFromQueryMiddleware` into every `Filament\Panel` `authMiddleware()` stack
- Adjusts Laravel’s middleware priority so the login middleware runs **before** auth middleware

This makes `logged=` work on routes like `/admin/...` and `/dashboard/...`.

Non-standard middleware stacks (non-Filament)
---------------------------------------------

[](#non-standard-middleware-stacks-non-filament)

This package registers the middleware into Laravel’s `web` group. If your application does **not** use the `web` group (or does not start sessions), you must add the middleware to the middleware stack that handles browser requests.

Behavior details
----------------

[](#behavior-details)

- **Invalid value** (missing / not numeric / `< 1`): redirect to the same URL without `logged`.
- **Unknown user ID**: returns **404**.
- **Already logged in as that user**: just strips `logged` and redirects.
- Only acts on **GET/HEAD** requests.

###  Health Score

39

—

LowBetter than 86% of packages

Maintenance82

Actively maintained with recent releases

Popularity6

Limited adoption so far

Community2

Small or concentrated contributor base

Maturity53

Maturing project, gaining track record

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~0 days

Total

2

Last Release

140d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/314f3009dfa2bbeec5895253f11aeba7246e3aa8b0cd1346b5015ef15cb8f773?d=identicon)[elfeffe](/maintainers/elfeffe)

---

Tags

middlewarelaravellocalloginElfeffe

### Embed Badge

![Health badge](/badges/elfeffe-local-login/health.svg)

```
[![Health](https://phpackages.com/badges/elfeffe-local-login/health.svg)](https://phpackages.com/packages/elfeffe-local-login)
```

###  Alternatives

[spatie/laravel-authorize

A middleware to check authorization

20125.8k1](/packages/spatie-laravel-authorize)[kronthto/laravel-oauth2-login

Provides a middleware to protect resources requiring an OAuth2 login

2117.5k1](/packages/kronthto-laravel-oauth2-login)[zefy/laravel-sso

Simple PHP SSO integration for Laravel

1013.0k](/packages/zefy-laravel-sso)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
