Buffalo Eats Online API Documentation

CustomerController extends Controller
in package

Customer management controller for client dashboard.

Provides customer listing, detail views, and mailing list management.

Tags
author

J.J. Johnson visionquest716@gmail.com

copyright

2026 VisionQuestServices LLC

Table of Contents

Properties

$layout  : string

Methods

exportCustomers()  : void
Export customers list as CSV.
index()  : void
List customers who have ordered from this business.
loginAsCustomer()  : void
Impersonate a customer (client action).
mailingList()  : void
Show the mailing list management page.
mailingListExport()  : void
Export mailing list as CSV download.
mailingListImport()  : void
Import mailing list subscribers from a CSV file.
mailingListRemove()  : void
Remove (unsubscribe) an email from the mailing list.
mailingListTemplate()  : void
Download a sample CSV template for mailing list import.
search()  : void
Search customers.
show()  : void
Show customer detail with order history.
stopImpersonation()  : void
Stop the current impersonation session (client action).
baseUrl()  : string
Get the base URL for the application.
buildPagination()  : array<string|int, mixed>
Build pagination metadata for views.
clearOldInput()  : void
Clear stored old input data.
flash()  : void
Set a flash message in the session.
flashOldInput()  : void
Store current POST data as old input for form repopulation.
getPage()  : int
Get the current page number from the query string.
json()  : void
Send a JSON response.
old()  : mixed
Get previous form input after validation failure.
redirect()  : void
Send an HTTP redirect.
requirePermission()  : void
Require that the authenticated client user has a specific permission.
url()  : string
Generate a full URL for a given path.
view()  : void
Render a view template wrapped in a layout.

Properties

Methods

exportCustomers()

Export customers list as CSV.

public exportCustomers() : void

index()

List customers who have ordered from this business.

public index() : void

loginAsCustomer()

Impersonate a customer (client action).

public loginAsCustomer(string $id) : void

Only allows impersonation of customers who have orders for this business.

Parameters
$id : string

Customer ID

mailingList()

Show the mailing list management page.

public mailingList() : void

mailingListExport()

Export mailing list as CSV download.

public mailingListExport() : void

mailingListImport()

Import mailing list subscribers from a CSV file.

public mailingListImport() : void

Expected CSV columns: email, name (optional) First row is treated as header if it contains "email".

mailingListRemove()

Remove (unsubscribe) an email from the mailing list.

public mailingListRemove() : void

mailingListTemplate()

Download a sample CSV template for mailing list import.

public mailingListTemplate() : void

show()

Show customer detail with order history.

public show(string $id) : void
Parameters
$id : string

Customer ID

stopImpersonation()

Stop the current impersonation session (client action).

public stopImpersonation() : void

baseUrl()

Get the base URL for the application.

protected baseUrl() : string
Return values
string

buildPagination()

Build pagination metadata for views.

protected buildPagination(int $total, int $page, int $perPage, string $baseUrl) : array<string|int, mixed>
Parameters
$total : int

Total record count

$page : int

Current page number

$perPage : int

Records per page

$baseUrl : string

Base URL path (e.g., "client/orders")

Return values
array<string|int, mixed>

Pagination metadata

clearOldInput()

Clear stored old input data.

protected clearOldInput() : void

flash()

Set a flash message in the session.

protected flash(string $key, string $message) : void
Parameters
$key : string

Flash message key (e.g., "success", "error")

$message : string

The message text

flashOldInput()

Store current POST data as old input for form repopulation.

protected flashOldInput() : void

getPage()

Get the current page number from the query string.

protected getPage() : int
Return values
int

Page number (minimum 1)

json()

Send a JSON response.

protected json(mixed $data[, int $status = 200 ]) : void
Parameters
$data : mixed

Data to encode as JSON

$status : int = 200

HTTP status code

old()

Get previous form input after validation failure.

protected old(string $field[, mixed $default = '' ]) : mixed
Parameters
$field : string

The form field name

$default : mixed = ''

Default value if not found

redirect()

Send an HTTP redirect.

protected redirect(string $url) : void
Parameters
$url : string

The URL to redirect to

requirePermission()

Require that the authenticated client user has a specific permission.

protected requirePermission(string $permission) : void

Redirects to the client dashboard with an error flash if denied.

Parameters
$permission : string

Permission key (e.g., 'menu_manage')

url()

Generate a full URL for a given path.

protected url([string $path = '' ]) : string
Parameters
$path : string = ''

The path to append to the base URL

Return values
string

view()

Render a view template wrapped in a layout.

protected view(string $template[, array<string|int, mixed> $data = [] ]) : void
Parameters
$template : string

Path to view relative to app/Views/ (e.g., "admin/dashboard")

$data : array<string|int, mixed> = []

Variables to extract into the view scope


        
On this page

Search results