Documentation

BookingController extends Controller

Table of Contents

HTTP_ERROR  = 'error'
HTTP_FAIL  = 'fail'
HTTP_SUCCESS  = 'success'
HTTP_UNAUTHORIZED  = 'unauthorized'
$objectName  : mixed
$repo  : mixed
__construct()  : mixed
all()  : string
allBoundedByDates()  : string
allChild()  : string
availableSlots()  : mixed
bookingAbsence()  : string
Save a booking as absence
bookingAbsenceUpdate()  : string
Change a pass bokking status as absence
bookingAccept()  : string
Update status from boonig given by uuid in the database to "accepted"
bookingCancel()  : string
Update status from boonig given by uuid in the database to "canceled".
bookingConfirm()  : string
Update status from boonig given by uuid in the database to "confirmed"
bookingReject()  : string
Update status from boonig given by uuid in the database to "rejected"
delete()  : string
deleteBookingAbsence()  : string
delete a booking absence from database
deleteChild()  : string
destroy()  : string
jsonResponse()  : Response
Centralices the return of a json response.
paginate()  : string
paginateChild()  : string
sendMail()  : bool
Send an email
show()  : string
showChild()  : string
store()  : string
storeChild()  : string
update()  : string
Update record from the database
updateAbsenceComment()  : string
Update internal_comment from absence
updateChild()  : string
updateStatus()  : string
Update record from the database
buildFailedValidationResponse()  : JsonResponse
Returns a "Not Acceptable" response
errorResponse()  : Response
Returns an error json response.
interceptCustomResponseLabels()  : array<string|int, mixed>
Returns a successful json response.
respondWithToken()  : mixed
successResponse()  : Response
Returns a successful json response.
unauthorizedResponse()  : Response
Returns a failed json response.

Constants

HTTP_SUCCESS

public mixed HTTP_SUCCESS = 'success'

HTTP_UNAUTHORIZED

public mixed HTTP_UNAUTHORIZED = 'unauthorized'

Properties

Methods

all()

public all(Request $request) : string
Parameters
$request : Request
Tags
desc

Return a database records

Return values
string

allBoundedByDates()

public allBoundedByDates(Request $request, mixed $start_date, mixed $end_date) : string
Parameters
$request : Request
$start_date : mixed
$end_date : mixed
Tags
desc

Return a database records

Return values
string

allChild()

public allChild(Request $request, int $parent_id) : string
Parameters
$request : Request

the HTTP request

$parent_id : int
  • Id of the parent objects that we want to get.
Tags
desc

Return a database records

Return values
string

availableSlots()

public availableSlots(Request $request) : mixed
Parameters
$request : Request
Return values
mixed

bookingAbsence()

Save a booking as absence

public bookingAbsence(Request $request) : string
Parameters
$request : Request
  • Datas of the object that we want to update.
Return values
string

bookingAbsenceUpdate()

Change a pass bokking status as absence

public bookingAbsenceUpdate(Request $request, mixed $id) : string
Parameters
$request : Request
  • Datas of the object that we want to update.
$id : mixed
Return values
string

bookingAccept()

Update status from boonig given by uuid in the database to "accepted"

public bookingAccept(string $uuid, string $token) : string
Parameters
$uuid : string
  • uuid of the booking to be confirmed.
$token : string
  • token of the booking to be confirmed.
Return values
string

bookingCancel()

Update status from boonig given by uuid in the database to "canceled".

public bookingCancel(string $uuid, string $token) : string
Parameters
$uuid : string
  • uuid of the booking to be canceled.
$token : string
  • token of the booking to be canceled.
Return values
string

bookingConfirm()

Update status from boonig given by uuid in the database to "confirmed"

public bookingConfirm(string $uuid, string $token) : string
Parameters
$uuid : string
  • uuid of the booking to be confirmed.
$token : string
  • token of the booking to be confirmed.
Return values
string

bookingReject()

Update status from boonig given by uuid in the database to "rejected"

public bookingReject(string $uuid, string $token) : string
Parameters
$uuid : string
  • uuid of the booking to be confirmed.
$token : string
  • token of the booking to be confirmed.
Return values
string

delete()

public delete(Request $request, int $id) : string
Parameters
$request : Request
$id : int
  • Id of the object that we want to remove.
Tags
desc

Delete record from the database

Return values
string

deleteBookingAbsence()

delete a booking absence from database

public deleteBookingAbsence(Request $request, mixed $id) : string
Parameters
$request : Request
  • Datas of the object that we want to update.
$id : mixed
Return values
string

deleteChild()

public deleteChild(Request $request, int $parent_id, int $id) : string
Parameters
$request : Request
  • Has the delete confirm field.
$parent_id : int
  • Id of the parent object that we want to delete.
$id : int
  • Id of the object that we want to delete.
Tags
desc

Delete record from the database

Return values
string

destroy()

public destroy(Request $request, int $id) : string
Parameters
$request : Request
$id : int
  • Id of the object that we want to remove.
Tags
desc

Destroy record from the database

Return values
string

jsonResponse()

Centralices the return of a json response.

public jsonResponse(int $httpCode, string $status, array<string|int, mixed> $data) : Response
Parameters
$httpCode : int
$status : string
$data : array<string|int, mixed>
Return values
Response

paginate()

public paginate(Request $request) : string
Parameters
$request : Request
Tags
desc

Return a database records

Return values
string

paginateChild()

public paginateChild(Request $request, int $parent_id) : string
Parameters
$request : Request

the HTTP request

$parent_id : int
  • Id of the parent objects that we want to get.
Tags
desc

Return a database records

Return values
string

sendMail()

Send an email

public sendMail( $mail, string $toEmail[, mixed $ccEmail = null ]) : bool
Parameters
$mail :
  • Mailable extended class to send
$toEmail : string
  • String with email
$ccEmail : mixed = null
Return values
bool

show()

public show(Request $request, array<string|int, mixed> $id) : string
Parameters
$request : Request
$id : array<string|int, mixed>
  • Id of the item to get.
Tags
desc

Return a database record

Return values
string

showChild()

public showChild(Request $request, int $parent_id, array<string|int, mixed> $id) : string
Parameters
$request : Request
$parent_id : int
  • Id of the parent object that we want to get.
$id : array<string|int, mixed>
  • Id of the item to get.
Tags
desc

Return a database record

Return values
string

store()

public store(Request $request) : string
Parameters
$request : Request
  • Data of the object that we want to create.
Tags
desc

Create a new booking in the database Once created by a Customer, sends email to manager and employee envolved

Return values
string

storeChild()

public storeChild(Request $request, int $parent_id) : string
Parameters
$request : Request
  • Data of the object that we want to create.
$parent_id : int
  • Id of the parent object that we want to create.
Tags
desc

Create a new record in the database

Return values
string

update()

Update record from the database

public update(Request $request, int $id) : string
Parameters
$request : Request
  • Datas of the object that we want to update.
$id : int
  • Id of the object that we want to update.
Return values
string

updateAbsenceComment()

Update internal_comment from absence

public updateAbsenceComment(Request $request, int $id) : string
Parameters
$request : Request
  • Datas of the object that we want to update.
$id : int
  • Id of the object that we want to update.
Return values
string

updateChild()

public updateChild(Request $request, int $parent_id, int $id) : string
Parameters
$request : Request
  • Datas of the object that we want to update.
$parent_id : int
  • Id of the parent object that we want to update.
$id : int
  • Id of the object that we want to update.
Tags
desc

Update record from the database

Return values
string

updateStatus()

Update record from the database

public updateStatus(Request $request, int $id) : string
Parameters
$request : Request
  • Datas of the object that we want to update.
$id : int
  • Id of the object that we want to update.
Return values
string

buildFailedValidationResponse()

Returns a "Not Acceptable" response

protected buildFailedValidationResponse(Request $request, array<string|int, mixed> $errors) : JsonResponse
Parameters
$request : Request
$errors : array<string|int, mixed>
Return values
JsonResponse

errorResponse()

Returns an error json response.

protected errorResponse([string $error = '' ]) : Response
Parameters
$error : string = ''
Return values
Response

interceptCustomResponseLabels()

Returns a successful json response.

protected interceptCustomResponseLabels(array<string|int, mixed> $data) : array<string|int, mixed>
Parameters
$data : array<string|int, mixed>
Return values
array<string|int, mixed>

$data

respondWithToken()

protected respondWithToken(mixed $token) : mixed
Parameters
$token : mixed
Return values
mixed

successResponse()

Returns a successful json response.

protected successResponse([array<string|int, mixed> $data = array() ][, mixed $isCreate = false ]) : Response
Parameters
$data : array<string|int, mixed> = array()
$isCreate : mixed = false
Return values
Response

unauthorizedResponse()

Returns a failed json response.

protected unauthorizedResponse(string $error) : Response
Parameters
$error : string
Return values
Response

Search results