PHP code example of ahmedash95 / users-verification
1. Go to this page and download the library: Download ahmedash95/users-verification 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/ */
ahmedash95 / users-verification example snippets
$user = App\User::find(1);
// Generate token or get it if exists
$user->getToken();
// check if user is verified or not
$user->isVerified()
// check if token is valid for user
$token = 'random_token_generated_by_getToken()_method'
$user->verifyToken($token) // return true or false
// verify the user
if($user->verifyToken($token)) {
$user->verify();
}
// remove user token
$user->flushToken();
use Illuminate\Foundation\Auth\User as Authenticatable;
use Ahmedash95\UsersVerification\UsersVerification;
class User extends Authenticatable
{
use UsersVerification;