mirror of
https://github.com/delight-im/PHP-Auth.git
synced 2025-08-02 22:27:30 +02:00
Group several sections in README under 'Accessing user information'
This commit is contained in:
14
README.md
14
README.md
@@ -248,7 +248,9 @@ $auth->logout();
|
|||||||
// user has been signed out
|
// user has been signed out
|
||||||
```
|
```
|
||||||
|
|
||||||
### Checking if the user is signed in
|
### Accessing user information
|
||||||
|
|
||||||
|
#### Login state
|
||||||
|
|
||||||
```php
|
```php
|
||||||
if ($auth->isLoggedIn()) {
|
if ($auth->isLoggedIn()) {
|
||||||
@@ -261,7 +263,7 @@ else {
|
|||||||
|
|
||||||
A shorthand/alias for this method is `$auth->check()`.
|
A shorthand/alias for this method is `$auth->check()`.
|
||||||
|
|
||||||
### Getting the user's ID
|
#### User ID
|
||||||
|
|
||||||
```php
|
```php
|
||||||
$id = $auth->getUserId();
|
$id = $auth->getUserId();
|
||||||
@@ -271,7 +273,7 @@ If the user is not currently signed in, this returns `null`.
|
|||||||
|
|
||||||
A shorthand/alias for this method is `$auth->id()`.
|
A shorthand/alias for this method is `$auth->id()`.
|
||||||
|
|
||||||
### Getting the user's email address
|
#### Email address
|
||||||
|
|
||||||
```php
|
```php
|
||||||
$email = $auth->getEmail();
|
$email = $auth->getEmail();
|
||||||
@@ -279,7 +281,7 @@ $email = $auth->getEmail();
|
|||||||
|
|
||||||
If the user is not currently signed in, this returns `null`.
|
If the user is not currently signed in, this returns `null`.
|
||||||
|
|
||||||
### Getting the user's display name
|
#### Display name
|
||||||
|
|
||||||
```php
|
```php
|
||||||
$email = $auth->getUsername();
|
$email = $auth->getUsername();
|
||||||
@@ -289,7 +291,7 @@ Remember that usernames are optional and there is only a username if you supplie
|
|||||||
|
|
||||||
If the user is not currently signed in, this returns `null`.
|
If the user is not currently signed in, this returns `null`.
|
||||||
|
|
||||||
### Checking if the user was "remembered"
|
#### Checking whether the user was "remembered"
|
||||||
|
|
||||||
```php
|
```php
|
||||||
if ($auth->isRemembered()) {
|
if ($auth->isRemembered()) {
|
||||||
@@ -302,7 +304,7 @@ else {
|
|||||||
|
|
||||||
If the user is not currently signed in, this returns `null`.
|
If the user is not currently signed in, this returns `null`.
|
||||||
|
|
||||||
### Getting the user's IP address
|
#### IP address
|
||||||
|
|
||||||
```php
|
```php
|
||||||
$ip = $auth->getIpAddress();
|
$ip = $auth->getIpAddress();
|
||||||
|
Reference in New Issue
Block a user