Ajax Comment System comes with a simple built in authentication driver that allows you to Log in, Sign up and edit your Account. By default this driver is used for the admin panel too.

Authenticating Users

To log a user in, use the Auth::attempt method.

$credentials = [
    'email'    => '',
    'passowrd' => 'test123',

if (Auth::attempt($credentials, true))  {

Determining If A User Is Authenticated

To determine if the user is logged in, use the Auth::check method:

if (Auth::check()) {
    echo 'Welcome!';

Accessing The Logged In User

Once a user is authenticated, you may access its attributes (id, name, email, role, avatar):

$name = Auth::user()->name;

Logging A User Out


Note: Check out user.php for a complete example including sign up and account.