PHPackages                             leo76/laravel-react-auth - 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. leo76/laravel-react-auth

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

leo76/laravel-react-auth
========================

A Laravel package providing a full React SPA authentication system with login, register, and dashboard.

1.0.0(1mo ago)03MITJavaScriptPHP ^8.1

Since Apr 13Pushed 1mo agoCompare

[ Source](https://github.com/Leo-76/Package-react-Laravel)[ Packagist](https://packagist.org/packages/leo76/laravel-react-auth)[ Docs](https://github.com/your-vendor/laravel-react-auth)[ RSS](/packages/leo76-laravel-react-auth/feed)WikiDiscussions main Synced 1w ago

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

Laravel React Auth
==================

[](#laravel-react-auth)

[![Latest Version on Packagist](https://camo.githubusercontent.com/587d75d505ac3e97f706d8c47cd68c419d79f7c15f17d7c6174ac0a6f167aa86/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6c656f37362f6c61726176656c2d72656163742d617574682e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/leo76/laravel-react-auth)[![Total Downloads](https://camo.githubusercontent.com/dc0fb1b830e6a33e5a552b33ad4ec5d6ed1abe8d9b8974923b9d69f9a2763711/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f6c656f37362f6c61726176656c2d72656163742d617574682e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/leo76/laravel-react-auth)[![PHP Version](https://camo.githubusercontent.com/196d1c229e907337435bb242b82542a3f5250b212368e95a67811ff04f2b74dd/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f7068702d762f6c656f37362f6c61726176656c2d72656163742d617574683f7374796c653d666c61742d737175617265)](https://packagist.org/packages/leo76/laravel-react-auth)[![License](https://camo.githubusercontent.com/16341eca12a2a85a33dec0b8ea713d77b193abbd1b968901384062960c652605/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6c6963656e73652f6c656f37362f6c61726176656c2d72656163742d617574683f7374796c653d666c61742d737175617265)](LICENSE)

> A Laravel package that drops in a complete **React + Inertia.js** authentication system in minutes — login, register, and a protected dashboard, all ready to customise.

---

Features
--------

[](#features)

Login with email, password &amp; remember-meRegister with validation &amp; password confirmationProtected dashboard pageLogout with session invalidationOne-command install: `php artisan react-auth:install`Tailwind CSS + React 18 + Inertia.jsFully publishable views, config &amp; migrationsToggle registration on/off via configFull PHPUnit feature test suite included---

📋 Requirements
--------------

[](#-requirements)

DependencyVersionPHP`^8.1`Laravel`^10.0` or `^11.0`Node.js`^18`inertiajs/inertia-laravel`^1.0`---

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

[](#installation)

### 1 — Install via Composer

[](#1--install-via-composer)

```
composer require leo76/laravel-react-auth
```

### 2 — Run the install command

[](#2--run-the-install-command)

```
php artisan react-auth:install
```

This publishes the **config**, **React pages**, and **migrations** into your project.

### 3 — Run migrations

[](#3--run-migrations)

```
php artisan migrate
```

### 4 — Install JS dependencies and build

[](#4--install-js-dependencies-and-build)

```
npm install
npm run dev
```

### 5 — Configure Inertia middleware

[](#5--configure-inertia-middleware)

**Laravel 11** — `bootstrap/app.php` :

```
->withMiddleware(function (Middleware $middleware) {
    $middleware->web(append: [
        \Inertia\Middleware::class,
    ]);
})
```

**Laravel 10** — `app/Http/Kernel.php` :

```
protected $middlewareGroups = [
    'web' => [
        // ...
        \Inertia\Middleware::class,
    ],
];
```

Set the root Blade view in `config/inertia.php` :

```
'root_view' => 'app',
```

---

Available Routes
----------------

[](#available-routes)

MethodURLRoute nameAccess`GET``/auth/login``react-auth.login`Guest`POST``/auth/login``react-auth.login.post`Guest`GET``/auth/register``react-auth.register`Guest`POST``/auth/register``react-auth.register.post`Guest`GET``/auth/dashboard``react-auth.dashboard`Auth`POST``/auth/logout``react-auth.logout`AuthVisit `/auth/login` in your browser to get started.

---

Configuration
-------------

[](#configuration)

Publish the config file:

```
php artisan vendor:publish --tag=react-auth-config
```

`config/react-auth.php` :

```
return [

    // URL prefix for all routes → /auth/login, /auth/register ...
    'route_prefix' => env('REACT_AUTH_PREFIX', 'auth'),

    // Eloquent model used for authentication
    'user_model' => \App\Models\User::class,

    // Set to false to disable the /register page and endpoint
    'allow_registration' => env('REACT_AUTH_REGISTRATION', true),

    // Middleware applied to all package routes
    'middleware' => ['web'],

];
```

---

Customising the React pages
---------------------------

[](#customising-the-react-pages)

```
php artisan vendor:publish --tag=react-auth-assets
```

Files are copied to :

```
resources/js/vendor/react-auth/
├── pages/
│   └── Auth/
│       ├── Login.jsx
│       ├── Register.jsx
│       └── Dashboard.jsx
└── components/
    └── InputField.jsx

```

Edit freely — the package will **never overwrite** published files.

---

Publish individually
--------------------

[](#publish-individually)

```
php artisan vendor:publish --tag=react-auth-config       # Config only
php artisan vendor:publish --tag=react-auth-assets        # React pages + CSS
php artisan vendor:publish --tag=react-auth-migrations    # Migrations only
```

---

Testing
-------

[](#testing)

```
composer test
```

The test suite covers login, register, logout, dashboard access, validation, and the registration toggle.

---

Package Structure
-----------------

[](#package-structure)

```
laravel-react-auth/
├── composer.json
├── config/react-auth.php
├── routes/auth.php
├── src/
│   ├── LaravelReactAuthServiceProvider.php
│   ├── Console/InstallCommand.php
│   ├── Http/
│   │   ├── Controllers/AuthController.php
│   │   └── Middleware/RedirectIfAuthenticated.php
│   └── database/migrations/
├── resources/
│   ├── views/app.blade.php
│   ├── css/app.css
│   └── js/
│       ├── app.jsx
│       ├── components/InputField.jsx
│       └── pages/Auth/
│           ├── Login.jsx
│           ├── Register.jsx
│           └── Dashboard.jsx
└── tests/Feature/AuthTest.php

```

---

Changelog
---------

[](#changelog)

See [CHANGELOG.md](CHANGELOG.md) for recent changes.

---

🤝 Contributing
--------------

[](#-contributing)

Pull requests are welcome! For major changes, please open an issue first.

1. Fork the repository
2. Create your branch: `git checkout -b feature/my-feature`
3. Commit: `git commit -m 'feat: add my feature'`
4. Push: `git push origin feature/my-feature`
5. Open a Pull Request

---

📄 License
---------

[](#-license)

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

---

Made with ❤️ for the Laravel community

###  Health Score

36

—

LowBetter than 79% of packages

Maintenance88

Actively maintained with recent releases

Popularity3

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity42

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

58d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/e5b8976e374fe398e250b83dde310685d3df348f7b992298812beab9b00d5f5c?d=identicon)[Leo-76](/maintainers/Leo-76)

---

Top Contributors

[![Leo-76](https://avatars.githubusercontent.com/u/209856038?v=4)](https://github.com/Leo-76 "Leo-76 (2 commits)")

---

Tags

laravelAuthenticationinertiareactSPA

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/leo76-laravel-react-auth/health.svg)

```
[![Health](https://phpackages.com/badges/leo76-laravel-react-auth/health.svg)](https://phpackages.com/packages/leo76-laravel-react-auth)
```

###  Alternatives

[psalm/plugin-laravel

Psalm plugin for Laravel

3325.1M337](/packages/psalm-plugin-laravel)[laravel-doctrine/orm

An integration library for Laravel and Doctrine ORM

8455.5M96](/packages/laravel-doctrine-orm)[hasinhayder/tyro

Tyro - The ultimate Authentication, Authorization, and Role &amp; Privilege Management solution for Laravel 12 &amp; 13

6753.6k5](/packages/hasinhayder-tyro)[erag/laravel-lang-sync-inertia

A powerful Laravel package for syncing and managing language translations across backend and Inertia.js (Vue/React) frontends, offering effortless localization, auto-sync features, and smooth multi-language support for modern Laravel applications.

4721.5k](/packages/erag-laravel-lang-sync-inertia)[hasinhayder/tyro-login

Tyro Login - Beautiful, customizable authentication views for Laravel 12 &amp; 13

2443.7k5](/packages/hasinhayder-tyro-login)[emargareten/inertia-modal

Inertia Modal is a Laravel package that lets you implement backend-driven modal dialogs for Inertia apps.

90128.1k](/packages/emargareten-inertia-modal)

PHPackages © 2026

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