Skip to content

KosmosX/support

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

24 Commits
 
 
 
 
 
 
 
 

Repository files navigation

KosmosX Support

composer require kosmosx/support

Register service poviders

/Kosmosx/Support/SupportServiceProvider::class

php artisan kosmosx:publish:support

Use it

$support = app('factory.support');

$statusSuccess = $support->success(200, $var, 'message...'); //return object StatusService 
$statusFail = $support->fail(400, $var, 'message...');       //return object StatusService


$statusFail->isSuccess() //return false
$statusFail->isFail()    //return true
$statusFail->toArray()
//result
[
    "success"=>false,
    "data"=>[...],
    "message"=>"message...",
    "statusCode"=>200
]

$api = $support->api()
$api->collection($data, $transformer, $includesData = null, $serializer = null) //Create collection with data Transformer

Route API auto discovery

\ApiService::apiDiscovery();

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages