PHP code example of jengo / auth

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

    

jengo / auth example snippets


// Check authentication
if (auth()->check()) {
    $user = auth()->user();
}

// Attempt login
auth()->attempt(['email' => $email, 'password' => $password], remember: true);

// Check permissions with Vima
if (can('posts.publish', $post)) {
    // Authorized
}
bash
composer ngo:auth setup
php spark migrate