1. Go to this page and download the library: Download toddish/verify 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/ */
// Create a new Permission
$permission = new Toddish\Verify\Models\Permission;
$permission->name = 'delete_user';
$permission->save();
// Create a new Role
$role = new Toddish\Verify\Models\Role;
$role->name = 'Moderator';
$role->level = 7;
$role->save();
// Assign the Permission to the Role
$role->permissions()->sync([$permission->id]);
// Create a new User
$user = new Toddish\Verify\Models\User;
$user->username = 'Todd';
$user->email = '[email protected]';
$user->password = 'password'; // This is automatically salted and encrypted
$user->save();
// Assign the Role to the User
$user->roles()->sync(array($role->id));
// Using the public methods available on the User object
var_dump($user->is('Moderator')); // true
var_dump($user->is('Admin')); // false
var_dump($user->can('delete_user')); // true
var_dump($user->can('add_user')); // false
var_dump($user->level(7)); // true
var_dump($user->level(5, '<=')); // false
use Toddish\Verify\Helpers\Verify;
switch (Auth::verify($credentials))
{
case Verify::SUCCESS:
// Successful log in
break;
case Verify::INVALID_CREDENTIALS:
case Verify::UNVERIFIED:
case Verify::DISABLED:
// Error!
break;
}
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.