PHP code example of innoboxrr / laravel-auth

1. Go to this page and download the library: Download innoboxrr/laravel-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/ */

    

innoboxrr / laravel-auth example snippets


'password' => [
    'length' => 8,
    'uppercase' => false,
    'number' => false,
],

'github' => [
    'client_id' => env('GITHUB_CLIENT_ID'),
    'client_secret' => env('GITHUB_CLIENT_SECRET'),
    'redirect' => '/auth/social/github/callback',
],

Gate::define('laravel-auth.impersonate', fn ($user, $target = null) => $user->hasRole('soporte'));

// Reglas del registro, por ejemplo para pedir más campos
RegisterRequest::setCustomRulesCallback(fn ($request) => [...]);

// Lo que responde get-auth
GetAuthRequest::$customGetAuthCallback = fn ($user) => response()->json([...]);

// Login social: entrar en una cuenta existente o registrar una nueva
CallbackRequest::$customLoginCallback = fn ($user, $provider, $providerUser) => ...;
CallbackRequest::$customRegisterCallback = fn ($providerUser, $provider) => ...;

// Sustituir por completo quién puede suplantar
ImpersonateRequest::authorizeUsing(fn ($request) => ...);
bash
php artisan vendor:publish --tag=laravel-auth-config