PHP code example of ghi / laravel-intranet-auth

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

    

ghi / laravel-intranet-auth example snippets


'providers' => [
    Ghi\IntranetAuth\IntranetAuthServiceProvider::class
];

    'driver' => 'ghi-intranet',

// app/Model.php

use Ghi\Core\App\Auth\AuthenticatableIntranetUser;

class User extends Model implements AuthenticatableContract, CanResetPasswordContract
{
    use AuthenticatableIntranetUser, CanResetPassword;

    //
}

    'model' => Ghi\Core\Models\User::class,

// app/Http/Controllers/AuthController.php

use Ghi\IntranetAuth\AuthenticatesIntranetUsers;

class AuthController extends Controller
{
    use AuthenticatesIntranetUsers, ThrottlesLogins;
    
    //
}

    protected $redirectPath = '/home';

    @

    php artisan vendor:publish

    Route::get('auth/login', [
        'as' => 'auth.login',
        'uses' => 'Auth\AuthController@getLogin'
    ]);
    
    Route::post('auth/login', [
        'as' => 'auth.login',
        'uses' => 'Auth\AuthController@postLogin'
    ]);
    
    Route::get('auth/logout', [
        'as' => 'auth.logout',
        'uses' => 'Auth\AuthController@getLogout'
    ]);