PHP code example of clarkeash / doorman

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

    

clarkeash / doorman example snippets


Doorman::generate()->make();

Doorman::generate()->times(5)->make();

Doorman::generate()->uses(10)->make();

Doorman::generate()->unlimited()->make();

$date = Carbon::now('UTC')->addDays(7);
Doorman::generate()->expiresOn($date)->make();

Doorman::generate()->expiresIn(14)->make();

Doorman::generate()->for('[email protected]')->make();

$invite = Doorman::generate()->for('[email protected]')->once();
dd($invite->code);

Doorman::redeem('ABCDE');
// or
Doorman::redeem('ABCDE', '[email protected]');

try {
    Doorman::redeem(request()->get('code'), request()->get('email'));
} catch (DoormanException $e) {
    return response()->json(['error' => $e->getMessage()], 422);
}

Doorman::check('ABCDE');
// or
Doorman::check('ABCDE', '[email protected]');

public function store(Request $request)
{
    $this->validate($request, [
        'email' => 'the user to the database.
}

return [
    'invite_table_name' => 'invites',
];
bash
$ php artisan migrate
bash
$ php artisan vendor:publish --tag=doorman-translations
`messages.php
`messages.php
bash
$ php artisan vendor:publish --tag=doorman-config
bash
$ php artisan doorman:cleanup