\App\Http\ControllersShopController

Class ShopController Default controller for FlyMyShop.

Summary

Methods
Properties
Constants
__construct()
checkChatID()
getChatID()
sendTelegram()
address()
home()
addAddress()
updateAddress()
refreshToken()
productDetails()
category()
cart()
addCart()
removeFromCart()
updateCart()
addFavourite()
removeFavourite()
favourites()
checkOut()
currency()
emptyCart()
page()
contact()
sendEmail()
search()
newsletter()
No public properties found
No constants found
No protected methods found
$telegram
N/A
No private methods found
No private properties found
N/A

Properties

$telegram

$telegram : 

Type

Methods

__construct()

__construct() 

checkChatID()

checkChatID() : boolean

Checking if there are any conversations to the bot.

Returns

boolean

getChatID()

getChatID() : mixed

if there are conversations returning the chat id.

Returns

mixed

sendTelegram()

sendTelegram(string  $msg) : integer

Send message to user's telegram.

Parameters

string $msg

Order related message e.g. Order no

Returns

integer

address()

address() : \View

Display list of all addresses for the user.

TODO: remove obsolete function.

Returns

\View

home()

home() : \View

Homepage of Shop.

Returns

\View

addAddress()

addAddress() : \View

Add address using API provided by third party TODO: Details of the third party service.

Returns

\View

updateAddress()

updateAddress() : void

Update the address on record using data from third party service TODO: Add third party info, update database.

refreshToken()

refreshToken() : void

Retrieve new token using refresh token method TODO: Replace with Laravel's passport.

productDetails()

productDetails(string  $slug) : \View

Fetch product from product_id.

Parameters

string $slug

product_id

Returns

\View

category()

category(string  $slug) : \View

Get all products belonging to the category based on category_id.

Parameters

string $slug

category_id

Returns

\View

cart()

cart() : \View

View shopping cart (Session based).

Returns

\View

addCart()

addCart() : mixed

Add a product to Cart.

Returns

mixed

removeFromCart()

removeFromCart() : mixed

Remove product from cart.

Returns

mixed

updateCart()

updateCart() : mixed

Update quantity of product in cart.

Returns

mixed

addFavourite()

addFavourite() : mixed

Add product to favourite (another Cart instance).

Returns

mixed

removeFavourite()

removeFavourite() : mixed

Remove product from favourites.

Returns

mixed

favourites()

favourites() : \View

View favourites.

Returns

\View

checkOut()

checkOut() : mixed

Perform the checkout operation.

Returns

mixed

currency()

currency(\Illuminate\Http\Request  $request, string  $iso) : mixed

Change shop currency.

Parameters

\Illuminate\Http\Request $request

user request

string $iso

currency code

Returns

mixed

emptyCart()

emptyCart() : mixed

Empty cart and redirect to homepage.

Returns

mixed

page()

page(string  $title, string  $page_id) : \View

View page from reading page_id.

Parameters

string $title

Page Title

string $page_id

page_id

Returns

\View

contact()

contact() : mixed

Return contact page.

Returns

mixed

sendEmail()

sendEmail(\App\Http\Controllers\ContactFormRequest  $request) : mixed

Send email after user submits contact form.

Parameters

\App\Http\Controllers\ContactFormRequest $request

user request

Returns

mixed

search()

search() : \View

Search utility.

Returns

\View

newsletter()

newsletter() : mixed

Add email to newletter list.

Returns

mixed