Files
spa-api/laravel/documentation/auth/config.md

38 lines
1.7 KiB
Markdown
Raw Normal View History

2012-04-02 11:02:09 -05:00
# Auth Configuration
## Contents
- [The Basics](#the-basics)
2012-05-21 10:48:15 -05:00
- [The Authentication Driver](#driver)
- [The Default "Username"](#username)
- [Authentication Model](#model)
- [Authentication Table](#table)
2012-04-02 11:02:09 -05:00
<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.
2012-05-21 10:48:15 -05:00
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.
2012-04-02 11:02:09 -05:00
2012-05-21 10:48:15 -05:00
<a name="driver"></a>
## The Authentication Driver
2012-04-02 11:02:09 -05:00
2012-05-21 10:48:15 -05:00
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!
2012-04-02 11:02:09 -05:00
2012-05-21 10:48:15 -05:00
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.
2012-04-02 11:02:09 -05:00
2012-05-21 10:48:15 -05:00
<a name="username"></a>
## The Default "Username"
2012-04-02 11:02:09 -05:00
2012-05-21 10:48:15 -05:00
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".
2012-04-02 11:02:09 -05:00
2012-05-21 10:48:15 -05:00
<a name="model"></a>
## Authentication Model
2012-04-02 11:02:09 -05:00
2012-05-21 10:48:15 -05:00
When using the **Eloquent** authentication driver, this option determines the Eloquent model that should be used when loading users.
2012-04-02 11:02:09 -05:00
2012-05-21 10:48:15 -05:00
<a name="table"></a>
## Authentication Table
2012-04-02 11:02:09 -05:00
2012-05-21 10:48:15 -05:00
When using the **Fluent** authentication drivers, this option determines the database table containing the users of your application.