PHP code example of leo76 / laravel-react-auth

1. Go to this page and download the library: Download leo76/laravel-react-auth library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

leo76 / laravel-react-auth example snippets


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

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

'root_view' => 'app',

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'],

];
bash
php artisan react-auth:install
bash
php artisan migrate
bash
php artisan vendor:publish --tag=react-auth-config
bash
php artisan vendor:publish --tag=react-auth-assets