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(6mo ago)010MITPHPPHP ^8.4

Since Dec 29Pushed 3mo 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 3mo 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

37

—

LowBetter than 81% of packages

Maintenance75

Regular maintenance activity

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

187d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/4717507?v=4)[federeggiani](/maintainers/elfeffe)[@elfeffe](https://github.com/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

[jeremy379/laravel-openid-connect

OpenID Connect support to the PHP League's OAuth2 Server. Compatible with Laravel Passport.

59437.0k9](/packages/jeremy379-laravel-openid-connect)[spatie/laravel-authorize

A middleware to check authorization

20726.4k1](/packages/spatie-laravel-authorize)[api-platform/laravel

API Platform support for Laravel

58171.6k14](/packages/api-platform-laravel)[ecotone/laravel

Ecotone for Laravel — CQRS, Event Sourcing, Sagas, Durable Workflows, and Outbox on top of Laravel Queue, via PHP attributes.

21318.6k3](/packages/ecotone-laravel)[kronthto/laravel-oauth2-login

Provides a middleware to protect resources requiring an OAuth2 login

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

Simple PHP SSO integration for Laravel

621.1k](/packages/mi-lopez-laravel-sso)

PHPackages © 2026

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