config.md 1.74 KB
Newer Older
Taylor Otwell committed
1 2 3 4 5
# Auth Configuration

## Contents

- [The Basics](#the-basics)
6 7 8 9
- [The Authentication Driver](#driver)
- [The Default "Username"](#username)
- [Authentication Model](#model)
- [Authentication Table](#table)
Taylor Otwell committed
10 11 12 13 14 15

<a name="the-basics"></a>
## The Basics

Most interactive applications have the ability for users to login and logout. Laravel provides a simple class to help you validate user credentials and retrieve information about the current user of your application.

16
To get started, let's look over the **application/config/auth.php** file. The authentication configuration contains some basic options to help you get started with authentication.
Taylor Otwell committed
17

18 19
<a name="driver"></a>
## The Authentication Driver
Taylor Otwell committed
20

21
Laravel's authentication is driver based, meaning the responsibility for retrieving users during authentication is delegated to various "drivers". Two are included out of the box: Eloquent and Fluent, but you are free to write your own drivers if needed!
Taylor Otwell committed
22

23
The **Eloquent** driver uses the Eloquent ORM to load the users of your application, and is the default authentication driver. The **Fluent** driver uses the fluent query builder to load your users.
Taylor Otwell committed
24

25 26
<a name="username"></a>
## The Default "Username"
Taylor Otwell committed
27

28
The second option in the configuration file determines the default "username" of your users. This will typically correspond to a database column in your "users" table, and will usually be "email" or "username".
Taylor Otwell committed
29

30 31
<a name="model"></a>
## Authentication Model
Taylor Otwell committed
32

33
When using the **Eloquent** authentication driver, this option determines the Eloquent model that should be used when loading users.
Taylor Otwell committed
34

35 36
<a name="table"></a>
## Authentication Table
Taylor Otwell committed
37

38
When using the **Fluent** authentication drivers, this option determines the database table containing the users of your application.