SMSController extends Controller
Table of Contents
- HTTP_ERROR = 'error'
- HTTP_FAIL = 'fail'
- HTTP_SUCCESS = 'success'
- HTTP_UNAUTHORIZED = 'unauthorized'
- DEBUG = 'debug'
- ERROR = 'error'
- $concat : mixed
- $debug : mixed
- $domainId : mixed
- $encoding : mixed
- default or unicode
- $login : mixed
- $objectName : mixed
- $password : mixed
- $repo : mixed
- $senderId : mixed
- $timeout : mixed
- $url : mixed
- __construct() : mixed
- all() : string
- allChild() : string
- delete() : string
- deleteChild() : string
- destroy() : string
- getConcat() : mixed
- getCredit() : mixed
- getDebug() : mixed
- getDomainId() : mixed
- getEncoding() : mixed
- getLogin() : mixed
- getPassword() : mixed
- getSenderId() : mixed
- getTimeout() : mixed
- jsonResponse() : Response
- Centralices the return of a json response.
- logMsg() : mixed
- paginate() : string
- paginateChild() : string
- sendMail() : bool
- Send an email
- sendSMS() : mixed
- Sends a SMS to the destination number
- setConcat() : mixed
- setDebug() : mixed
- setDomainId() : mixed
- setEncoding() : mixed
- setLogin() : mixed
- setPassword() : mixed
- setSenderId() : mixed
- setTimeout() : mixed
- show() : string
- showChild() : string
- store() : string
- storeChild() : string
- update() : string
- updateChild() : string
- 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_ERROR
public
mixed
HTTP_ERROR
= 'error'
HTTP_FAIL
public
mixed
HTTP_FAIL
= 'fail'
HTTP_SUCCESS
public
mixed
HTTP_SUCCESS
= 'success'
HTTP_UNAUTHORIZED
public
mixed
HTTP_UNAUTHORIZED
= 'unauthorized'
DEBUG
private
mixed
DEBUG
= 'debug'
ERROR
private
mixed
ERROR
= 'error'
Properties
$concat
protected
mixed
$concat
$debug
protected
mixed
$debug
$domainId
protected
mixed
$domainId
$encoding
default or unicode
protected
mixed
$encoding
$login
protected
mixed
$login
$objectName
protected
mixed
$objectName
$password
protected
mixed
$password
$repo
protected
mixed
$repo
$senderId
protected
mixed
$senderId
$timeout
protected
mixed
$timeout
$url
protected
mixed
$url
= 'http://www.altiria.net/api/http'
Methods
__construct()
public
__construct() : mixed
Return values
mixed —all()
public
all(Request $request) : string
Parameters
- $request : Request
Tags
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
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
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
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
Return values
string —getConcat()
public
getConcat() : mixed
Return values
mixed —getCredit()
public
getCredit() : mixed
Return values
mixed —getDebug()
public
getDebug() : mixed
Return values
mixed —getDomainId()
public
getDomainId() : mixed
Return values
mixed —getEncoding()
public
getEncoding() : mixed
Return values
mixed —getLogin()
public
getLogin() : mixed
Return values
mixed —getPassword()
public
getPassword() : mixed
Return values
mixed —getSenderId()
public
getSenderId() : mixed
Return values
mixed —getTimeout()
public
getTimeout() : mixed
Return values
mixed —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 —logMsg()
public
logMsg(mixed $msg[, mixed $type = 'debug' ]) : mixed
Parameters
- $msg : mixed
- $type : mixed = 'debug'
Return values
mixed —paginate()
public
paginate(Request $request) : string
Parameters
- $request : Request
Tags
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
Return values
string —sendMail()
Send an email
public
sendMail( $mail, string $toEmail[, mixed $ccEmail = null ]) : bool
Parameters
Return values
bool —sendSMS()
Sends a SMS to the destination number
public
sendSMS( $destination, $message) : mixed
Parameters
- $destination :
-
: international whitout prefix ’00’ nor ’+’. Example: 34645852126. Country prefix is madatory (34 for Spain). Max 16 digits.
- $message :
-
: 160 max with default encoding (extended chars size double).
Tags
Return values
mixed —setConcat()
public
setConcat(mixed $val) : mixed
Parameters
- $val : mixed
Return values
mixed —setDebug()
public
setDebug(mixed $val) : mixed
Parameters
- $val : mixed
Return values
mixed —setDomainId()
public
setDomainId(mixed $val) : mixed
Parameters
- $val : mixed
Return values
mixed —setEncoding()
public
setEncoding(mixed $val) : mixed
Parameters
- $val : mixed
Return values
mixed —setLogin()
public
setLogin(mixed $val) : mixed
Parameters
- $val : mixed
Return values
mixed —setPassword()
public
setPassword(mixed $val) : mixed
Parameters
- $val : mixed
Return values
mixed —setSenderId()
public
setSenderId(mixed $val) : mixed
Parameters
- $val : mixed
Return values
mixed —setTimeout()
public
setTimeout(mixed $val) : mixed
Parameters
- $val : mixed
Return values
mixed —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
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
Return values
string —store()
public
store(Request $request) : string
Parameters
- $request : Request
-
- Data of the object that we want to create.
Tags
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
Return values
string —update()
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.
Tags
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
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