User
extends Model
in package
User Model Inherits from the Model class of Laravel
Tags
Table of Contents
- $avatar : string
- $firstname : string
- $is_admin : mixed
- $last_ip : string
- $last_login : mixed
- $lastname : string
- $mail : string
- $password : string
- $timestamps : mixed
- $totp_key : string
- $updated : mixed
- $user_id : int
- $username : string
- $guarded : mixed
- $primaryKey : mixed
- $table : mixed
- __construct() : mixed
- Constructor Force the user_id to -1
- authenticate() : mixed
- Authenticate the user Fill the $_SESSION array and update some vars from the database
- canInteractWithList() : bool
- Check if the user can interact with a list
- create2FA() : mixed
- Associate 2FA with the user
- find() :
- isAdmin() : bool
- Check if the user is an adminisrator
- logout() : mixed
- Logout the user
- name() : string
- Return the user's firstname and lastname
- remove2FA() : mixed
- Disassociate 2FA of the user
- where() :
- whereMail() :
- whereUsername() :
Properties
$avatar
public
string
$avatar
$firstname
public
string
$firstname
$is_admin
public
mixed
$is_admin
$last_ip
public
string
$last_ip
$last_login
public
mixed
$last_login
$lastname
public
string
$lastname
public
string
$mail
$password
public
string
$password
$timestamps
public
mixed
$timestamps
= false
$totp_key
public
string
$totp_key
$updated
public
mixed
$updated
$user_id
public
int
$user_id
$username
public
string
$username
$guarded
protected
mixed
$guarded
= ['user_id', 'created_at']
$primaryKey
protected
mixed
$primaryKey
= 'user_id'
$table
protected
mixed
$table
= 'accounts'
Methods
__construct()
Constructor Force the user_id to -1
public
__construct() : mixed
Return values
mixed —authenticate()
Authenticate the user Fill the $_SESSION array and update some vars from the database
public
authenticate() : mixed
Return values
mixed —canInteractWithList()
Check if the user can interact with a list
public
canInteractWithList(Liste $list) : bool
Parameters
- $list : Liste
-
List to check
Return values
bool —true if user can interact, false otherwise
create2FA()
Associate 2FA with the user
public
create2FA(string $secret) : mixed
Parameters
- $secret : string
-
2FA secret key
Return values
mixed —find()
public
static find(int $USER_ID) :
Eloquent method
Parameters
- $USER_ID : int
Return values
—isAdmin()
Check if the user is an adminisrator
public
isAdmin() : bool
Return values
bool —true if is admin, false otherwise
logout()
Logout the user
public
static logout() : mixed
Return values
mixed —name()
Return the user's firstname and lastname
public
name() : string
Return values
string —remove2FA()
Disassociate 2FA of the user
public
remove2FA() : mixed
Return values
mixed —where()
public
static where(string $string, string $string1, string $string2) :
Eloquent method
Parameters
- $string : string
- $string1 : string
- $string2 : string
Return values
—whereMail()
public
static whereMail(string $email) :
Eloquent method
Parameters
- $email : string
Return values
—whereUsername()
public
static whereUsername(string $username) :
Eloquent method
Parameters
- $username : string