PHP Class Jrean\UserVerification\UserVerification

Datei anzeigen Open project: jrean/laravel-user-verification

Protected Properties

Property Type Description
$emailView string E-mail view name.
$mailer Illuminate\Contracts\Mail\Mailer Mailer instance.
$schema Illuminate\Database\Schema\Builder Schema builder instance.

Public Methods

Method Description
__construct ( Illuminate\Contracts\Mail\Mailer $mailer, Illuminate\Database\Schema\Builder $schema ) : void Create a new instance.
emailView ( string $name ) : Jrean\UserVerification Set the e-mail view name.
generate ( Illuminate\Contracts\Auth\Authenticatable $user ) : boolean Generate and save a verification token for the given user.
process ( string $email, string $token, string $userTable ) : void Process the user verification for the given e-mail and token.
send ( Illuminate\Contracts\Auth\Authenticatable $user, string $subject = null, string $from = null, string $name = null ) : boolean Send by e-mail a link containing the verification token.
sendLater ( integer $seconds, Illuminate\Contracts\Auth\Authenticatable $user, string $subject = null, string $from = null, string $name = null ) : boolean Send later by e-mail a link containing the verification token.
sendLaterOn ( string $queue, integer $seconds, Illuminate\Contracts\Auth\Authenticatable $user, string $subject = null, string $from = null, string $name = null ) : boolean Send later on the given queue by e-mail a link containing the verification token.
sendQueue ( Illuminate\Contracts\Auth\Authenticatable $user, string $subject = null, string $from = null, string $name = null ) : boolean Queue and send by e-mail a link containing the verification token.
sendQueueOn ( string $queue, Illuminate\Contracts\Auth\Authenticatable $user, string $subject = null, string $from = null, string $name = null ) : boolean Queue on the given queue and send by e-mail a link containing the verification token.

Protected Methods

Method Description
emailLaterOnVerificationLink ( $queue, integer $seconds, Illuminate\Contracts\Auth\Authenticatable $user, string $subject, string $from = null, string $name = null ) : mixed Prepare and send later on the given queue the e-mail with the verification token link.
emailLaterVerificationLink ( integer $seconds, Illuminate\Contracts\Auth\Authenticatable $user, string $subject, string $from = null, string $name = null ) : mixed Prepare and send later the e-mail with the verification token link.
emailQueueOnVerificationLink ( string $queue, Illuminate\Contracts\Auth\Authenticatable $user, string $subject, string $from = null, string $name = null ) : mixed Prepare and push a job onto the given queue to send the e-mail with the verification token link.
emailQueueVerificationLink ( Illuminate\Contracts\Auth\Authenticatable $user, string $subject, string $from = null, string $name = null ) : mixed Prepare and push a job onto the queue to send the e-mail with the verification token link.
emailVerificationLink ( Illuminate\Contracts\Auth\Authenticatable $user, string $subject, string $from = null, string $name = null ) : mixed Prepare and send the e-mail with the verification token link.
generateToken ( ) : string | boolean Generate the verification token.
getUserByEmail ( string $email, string $table ) : stdClass Get the user by e-mail.
hasColumn ( Illuminate\Contracts\Auth\Authenticatable $user, string $column ) : boolean Check if the given model talbe has the given column.
isCompliant ( Illuminate\Contracts\Auth\Authenticatable $user ) : boolean Determine if the given model table has the verified and verification_token columns.
isVerified ( stdClass $user ) : void Check if the given user is verified.
saveToken ( Illuminate\Contracts\Auth\Authenticatable $user, string $token ) : boolean Update and save the model instance with the verification token.
updateUser ( stdClass $user ) : void Update and save user object.
verifyToken ( string $storedToken, string $requestToken ) : void Compare the two given tokens.
wasVerified ( stdClass $user ) : void Update and save the given user as verified.

Method Details

__construct() public method

Create a new instance.
public __construct ( Illuminate\Contracts\Mail\Mailer $mailer, Illuminate\Database\Schema\Builder $schema ) : void
$mailer Illuminate\Contracts\Mail\Mailer
$schema Illuminate\Database\Schema\Builder
return void

emailView() public method

Set the e-mail view name.
public emailView ( string $name ) : Jrean\UserVerification
$name string
return Jrean\UserVerification

generate() public method

Generate and save a verification token for the given user.
public generate ( Illuminate\Contracts\Auth\Authenticatable $user ) : boolean
$user Illuminate\Contracts\Auth\Authenticatable
return boolean

generateToken() protected method

Generate the verification token.
protected generateToken ( ) : string | boolean
return string | boolean

getUserByEmail() protected method

Get the user by e-mail.
protected getUserByEmail ( string $email, string $table ) : stdClass
$email string
$table string
return stdClass

hasColumn() protected method

Check if the given model talbe has the given column.
protected hasColumn ( Illuminate\Contracts\Auth\Authenticatable $user, string $column ) : boolean
$user Illuminate\Contracts\Auth\Authenticatable
$column string
return boolean

isCompliant() protected method

Determine if the given model table has the verified and verification_token columns.
protected isCompliant ( Illuminate\Contracts\Auth\Authenticatable $user ) : boolean
$user Illuminate\Contracts\Auth\Authenticatable
return boolean

isVerified() protected method

Check if the given user is verified.
protected isVerified ( stdClass $user ) : void
$user stdClass
return void

process() public method

Process the user verification for the given e-mail and token.
public process ( string $email, string $token, string $userTable ) : void
$email string
$token string
$userTable string
return void

saveToken() protected method

Update and save the model instance with the verification token.
protected saveToken ( Illuminate\Contracts\Auth\Authenticatable $user, string $token ) : boolean
$user Illuminate\Contracts\Auth\Authenticatable
$token string
return boolean

send() public method

Send by e-mail a link containing the verification token.
public send ( Illuminate\Contracts\Auth\Authenticatable $user, string $subject = null, string $from = null, string $name = null ) : boolean
$user Illuminate\Contracts\Auth\Authenticatable
$subject string
$from string
$name string
return boolean

sendLater() public method

Send later by e-mail a link containing the verification token.
public sendLater ( integer $seconds, Illuminate\Contracts\Auth\Authenticatable $user, string $subject = null, string $from = null, string $name = null ) : boolean
$seconds integer
$user Illuminate\Contracts\Auth\Authenticatable
$subject string
$from string
$name string
return boolean

sendLaterOn() public method

Send later on the given queue by e-mail a link containing the verification token.
public sendLaterOn ( string $queue, integer $seconds, Illuminate\Contracts\Auth\Authenticatable $user, string $subject = null, string $from = null, string $name = null ) : boolean
$queue string
$seconds integer
$user Illuminate\Contracts\Auth\Authenticatable
$subject string
$from string
$name string
return boolean

sendQueue() public method

Queue and send by e-mail a link containing the verification token.
public sendQueue ( Illuminate\Contracts\Auth\Authenticatable $user, string $subject = null, string $from = null, string $name = null ) : boolean
$user Illuminate\Contracts\Auth\Authenticatable
$subject string
$from string
$name string
return boolean

sendQueueOn() public method

Queue on the given queue and send by e-mail a link containing the verification token.
public sendQueueOn ( string $queue, Illuminate\Contracts\Auth\Authenticatable $user, string $subject = null, string $from = null, string $name = null ) : boolean
$queue string
$user Illuminate\Contracts\Auth\Authenticatable
$subject string
$from string
$name string
return boolean

updateUser() protected method

Update and save user object.
protected updateUser ( stdClass $user ) : void
$user stdClass
return void

verifyToken() protected method

Compare the two given tokens.
protected verifyToken ( string $storedToken, string $requestToken ) : void
$storedToken string
$requestToken string
return void

wasVerified() protected method

Update and save the given user as verified.
protected wasVerified ( stdClass $user ) : void
$user stdClass
return void

Property Details

$emailView protected_oe property

E-mail view name.
protected string $emailView
return string

$mailer protected_oe property

Mailer instance.
protected Mailer,Illuminate\Contracts\Mail $mailer
return Illuminate\Contracts\Mail\Mailer

$schema protected_oe property

Schema builder instance.
protected Builder,Illuminate\Database\Schema $schema
return Illuminate\Database\Schema\Builder