PHPackages                             randohinn/userfile - 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. randohinn/userfile

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

randohinn/userfile
==================

Adds file-based user login functionality to Laravel's Auth flow.

1.0(7y ago)42MITPHPPHP ^7.1

Since Jul 29Pushed 3y ago1 watchersCompare

[ Source](https://github.com/randohinn/laravel-userfile)[ Packagist](https://packagist.org/packages/randohinn/userfile)[ RSS](/packages/randohinn-userfile/feed)WikiDiscussions master Synced 2mo ago

READMEChangelog (1)Dependencies (2)Versions (2)Used By (0)

Laravel Userfile
================

[](#laravel-userfile)

[![Latest Version on Packagist](https://camo.githubusercontent.com/475bb76fd94d2aab4e895d8752b896eb63ebd5f2ddb36e6bb8230bd8c45798ff/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f72616e646f68696e6e2f7573657266696c652e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/randohinn/userfile)

UNMAINTAINED AND OF UNKNOWN WORKING STATUS
==========================================

[](#unmaintained-and-of-unknown-working-status)

Userfile is a Laravel package that allows storing user data in yaml files. It also supports Bearer type API authentication.

Usage
-----

[](#usage)

### Installation

[](#installation)

Generate Laravel's default auth scafffolding. `php artisan make:auth`.

You can install the package by running

```
composer require randohinn/userfile

```

Laravel will auto-detect and register the neccessary provider and auth configuration.

Next, run

```
php artisan vendor:publish

```

This will create a `config/userfile.php` file in your app.

### Setup

[](#setup)

Userfile uses the default Laravel user model. Therefore, it is necessary to make these changes to the model.

Add `public $incrementing = false;` to the model. This enables the use of string-based uuids, that Userfile generates for your users.

Add `id` and `api_token` to the `$fillable` array of the model. This allows the package to populate those fields on your model instances. It is in this array where you will later define any custom fields you would like to store in the user file.

### Configuration

[](#configuration)

By default, Userfile expects to find a `userfile` folder in your storage folder. You can change this, by creating a custom filesystem disk in the filyesystem config, and editing `config/userfile.php` to state the name of the new disk, instead of `userfile`. In this file, you can also define a subfolder or your user files, if that is what you want.

The last part, is to set your `config/auth.php` to contain `'guard' => 'userfile',` instead of the default `'guard' => 'web'`. You may the delete unnecessary auth controllers.

Creating users
--------------

[](#creating-users)

Userfile expects to find files in your configured disk's configured subfolder. Filenames go by the standard of `user-email.yaml`. For example `rando@randohinn.com.yaml`.

At the bare minimum, when creating a new user file, it needs to contin the user's email, name and password (in plaintext). The password **will be encrypted on first log-in!**

For example:

```
name: 'Rando Hinn'
email: rando@randohinn.com
password: qwerty
```

After you log in with the first user, for the first time, several things will happen:

- The user will be generated a uuid and an api key
- The user's password will be encryped and the encrypted hash stored instead of plaintext
- An `id_mapping.yaml` and `api_mapping.yaml` file will be created next to the user file. These files hold the mapping of id's and API tokens back to user e-mails, to facilitate faster lookups, and should **not be deleted**.

As a result, your user file may look something like this:

```
name: 'Rando Hinn'
email: rando@randohinn.com
password: $2y$10$RHOsWnmZjAQ2o1fceqZ.Nu.Isa6XBIdFAXmEGlb7SZEWfU/cfTScq
id: fb4ac678-0802-473b-be64-dcba94b40e8a
api_token: UmikrAAteG8KWneIREBnp4sQRCbA0HDFjWAUsrQ59m5e5b6RWtS72uQzdiQT
```

Should you want to add any fields, just add them to this file, and define them in the model's `$fillable` array, like you normally would.

License
-------

[](#license)

The MIT License. See [License.md](LICENSE.md) for more information.

Contributing
------------

[](#contributing)

All contributions welcome. Before you start working on something, please create an issue for it.

If you find a security-related bug, please write directly to  . **Do not create a GitHub issue!**

###  Health Score

25

—

LowBetter than 37% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity6

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity57

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

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

Unknown

Total

1

Last Release

2847d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/987ac2e4726a8358f0aa42660c9f26af416017473e129cb3560af316370876bc?d=identicon)[randohinn](/maintainers/randohinn)

---

Top Contributors

[![randohinn](https://avatars.githubusercontent.com/u/14096473?v=4)](https://github.com/randohinn "randohinn (7 commits)")

### Embed Badge

![Health badge](/badges/randohinn-userfile/health.svg)

```
[![Health](https://phpackages.com/badges/randohinn-userfile/health.svg)](https://phpackages.com/packages/randohinn-userfile)
```

###  Alternatives

[bezhansalleh/filament-shield

Filament support for `spatie/laravel-permission`.

2.8k2.9M88](/packages/bezhansalleh-filament-shield)[illuminate/auth

The Illuminate Auth package.

9327.3M1.0k](/packages/illuminate-auth)[olssonm/l5-very-basic-auth

Laravel stateless HTTP basic auth without the need for a database

1662.5M1](/packages/olssonm-l5-very-basic-auth)[scaler-tech/laravel-saml2

SAML2 Service Provider integration for Laravel applications, based on OneLogin toolkit

2737.5k](/packages/scaler-tech-laravel-saml2)[truckersmp/steam-socialite

Laravel Socialite provider for Steam OpenID.

1516.7k](/packages/truckersmp-steam-socialite)[pschocke/laravel-telegram-login-widget

Easily integrate Telegrams login widget into your Laravel application to send Telegram messages

1610.4k](/packages/pschocke-laravel-telegram-login-widget)

PHPackages © 2026

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