\App\Http\ControllersAdminController

Class AdminController Controller for admin area.

Summary

Methods
Properties
Constants
save()
welcome()
reports()
users()
payment()
orders()
updateOrderStatus()
updateUserStatus()
processRefund()
viewOrder()
returnNumber()
settings()
updateSettings()
generateReport()
No public properties found
No constants found
stats()
salesGraphData()
getGraphWithCompleteValues()
getMonthNamesFromNumbers()
getSumArray()
No protected properties found
N/A
No private methods found
No private properties found
N/A

Methods

save()

save(array  $shop_config = array()) : boolean

Save to .env file If new key is supplied it will be appended If existing key is supplied, value will be replaced If the key is not supplied, then the line will be ignored.

Parameters

array $shop_config

Returns

boolean

welcome()

welcome() : \View

Display admin dashboard.

Returns

\View

reports()

reports() : \View

Generate reports view.

Returns

\View

users()

users() : \View

Return paginated list of users.

Returns

\View

payment()

payment() : \View

Return list of sales from stripe.

Returns

\View

orders()

orders() : \View

List of orders.

Returns

\View

updateOrderStatus()

updateOrderStatus(\Illuminate\Http\Request  $request) : mixed

Update status of the order.

Parameters

\Illuminate\Http\Request $request

Status update request

Returns

mixed

updateUserStatus()

updateUserStatus(\Illuminate\Http\Request  $request) : mixed

Update status of the user.

Parameters

\Illuminate\Http\Request $request

Returns

mixed

processRefund()

processRefund(\Illuminate\Http\Request  $request) : \Illuminate\Support\Facades\Redirect

Process refund for charge and redirect to payments.

Parameters

\Illuminate\Http\Request $request

Returns

\Illuminate\Support\Facades\Redirect

viewOrder()

viewOrder(integer  $id) : \View

View individual order TODO: reuse code in account controller. Move to helper.

Parameters

integer $id

order_id

Returns

\View

returnNumber()

returnNumber(  $value) : integer|string

TODO: move as helper.

Parameters

$value

Returns

integer|string

settings()

settings() : \View

Settings view for FlyMyShop.

Returns

\View

updateSettings()

updateSettings(\Illuminate\Http\Request  $request) : \Illuminate\Support\Facades\Redirect

Update settings value in database and .env file.

Parameters

\Illuminate\Http\Request $request

Returns

\Illuminate\Support\Facades\Redirect

generateReport()

generateReport() : array

Grab data for the last one year.

Returns

array

stats()

stats() : array

Get sales stats for admin pages.

Returns

array

salesGraphData()

salesGraphData() : mixed

Generate data for the last one year.

Returns

mixed

getGraphWithCompleteValues()

getGraphWithCompleteValues(  $graph) : array

Fill-in the missing months with revenue =0.

Parameters

$graph

Returns

array

getMonthNamesFromNumbers()

getMonthNamesFromNumbers(  $months) : array

Convert month number to name.

Parameters

$months

Returns

array

getSumArray()

getSumArray(  $fullGraph) : array

Extract the sum key from the main array and create a sub-array.

Parameters

$fullGraph

Returns

array