Buffalo Eats Online API Documentation

AuthService
in package

Authentication service with multi-guard support.

Supports three separate auth guards: admin, client, customer. Each guard uses its own session namespace and database table.

Tags
author

J.J. Johnson visionquest716@gmail.com

copyright

2026 VisionQuestServices LLC

Table of Contents

Constants

GUARD_TABLES  = ['admin' => 'admins', 'client' => 'users', 'customer' => 'customers']

Methods

attempt()  : array<string|int, mixed>|null
Attempt to authenticate a user for a given guard.
business()  : array<string|int, mixed>|null
Get the authenticated client's business data.
check()  : bool
Check if a user is authenticated for the given guard.
id()  : int|null
Get the authenticated user's ID for the given guard.
logout()  : void
Log out the user for the given guard.
refreshBusiness()  : void
Refresh the business data in session (after updates).
user()  : array<string|int, mixed>|null
Get the authenticated user for the given guard.
getTable()  : string
Get the database table for a guard.

Constants

GUARD_TABLES

private array<string|int, mixed> GUARD_TABLES = ['admin' => 'admins', 'client' => 'users', 'customer' => 'customers']

Guard-to-table mapping

Methods

attempt()

Attempt to authenticate a user for a given guard.

public static attempt(string $guard, string $email, string $password) : array<string|int, mixed>|null
Parameters
$guard : string

Guard name (admin, client, customer)

$email : string

Email address

$password : string

Plain-text password

Return values
array<string|int, mixed>|null

Authenticated user record, or null on failure

business()

Get the authenticated client's business data.

public static business() : array<string|int, mixed>|null
Return values
array<string|int, mixed>|null

check()

Check if a user is authenticated for the given guard.

public static check(string $guard) : bool
Parameters
$guard : string

Guard name

Return values
bool

id()

Get the authenticated user's ID for the given guard.

public static id(string $guard) : int|null
Parameters
$guard : string

Guard name

Return values
int|null

logout()

Log out the user for the given guard.

public static logout(string $guard) : void
Parameters
$guard : string

Guard name

refreshBusiness()

Refresh the business data in session (after updates).

public static refreshBusiness(int $businessId) : void
Parameters
$businessId : int

Business ID

user()

Get the authenticated user for the given guard.

public static user(string $guard) : array<string|int, mixed>|null
Parameters
$guard : string

Guard name

Return values
array<string|int, mixed>|null

getTable()

Get the database table for a guard.

private static getTable(string $guard) : string
Parameters
$guard : string

Guard name

Tags
throws
InvalidArgumentException

If guard is invalid

Return values
string

        
On this page

Search results