All Projects → KosmosX → response

KosmosX / response

Licence: other
Response HTTP package for Simfony, Laravel, Lumen and PHP 7 with standard REST API

Programming Languages

PHP
23972 projects - #3 most used programming language

Projects that are alternatives of or similar to response

laravel-snowflake
This Laravel package to generate 64 bit identifier like the snowflake within Twitter.
Stars: ✭ 94 (+571.43%)
Mutual labels:  lumen, laravel-package, lumen-package
video-downloader
Video Downloader for Facebook.
Stars: ✭ 63 (+350%)
Mutual labels:  package, lumen, laravel-package
Laravel-Auto-Hard-Deleter
Laravel and Lumen Auto Hard Deleter
Stars: ✭ 34 (+142.86%)
Mutual labels:  lumen, laravel-package, lumen-package
Laravel Pdf
A Simple package for easily generating PDF documents from HTML. This package is specially for laravel but you can use this without laravel.
Stars: ✭ 79 (+464.29%)
Mutual labels:  package, laravel-package
laravel-username-generator
Automatically generate usernames for Laravel User Model
Stars: ✭ 37 (+164.29%)
Mutual labels:  package, laravel-package
Package Skeleton
📦 My base for PHP packages.
Stars: ✭ 6 (-57.14%)
Mutual labels:  package, laravel-package
Lumen Api Starter
Lumen 8 基础上扩展出的API 启动项目,精心设计的目录结构,规范统一的响应数据格式,Repository 模式架构的最佳实践。
Stars: ✭ 197 (+1307.14%)
Mutual labels:  lumen, restful-api
Laravel Short Url
A Laravel package to shorten urls
Stars: ✭ 127 (+807.14%)
Mutual labels:  package, laravel-package
Laravel Google Translate
This package makes using the Google Translate API in your laravel app a breeze with minimum to no configuration, clean syntax and a consistent package API.
Stars: ✭ 97 (+592.86%)
Mutual labels:  package, laravel-package
Blogetc
Easily add a full Laravel blog (with built in admin panel and public views) to your laravel project with this simple package.
Stars: ✭ 198 (+1314.29%)
Mutual labels:  package, laravel-package
Laravel Gitscrum
GitScrum is a Project Management Tool, developed to help entrepreneurs, freelancers, managers, and teams Skyrocket their Productivity with the Agile methodology and Gamification.
Stars: ✭ 2,686 (+19085.71%)
Mutual labels:  package, laravel-package
symfony-todo-backend
This is the result of all the videos that were created in the series that i published on the playlist. LINK BELOW
Stars: ✭ 172 (+1128.57%)
Mutual labels:  restful-api, symfony-api
dropzoner
Laravel package for image upload using DropzoneJS
Stars: ✭ 46 (+228.57%)
Mutual labels:  package, laravel-package
Laravel Aws Sns
Laravel package for the AWS SNS Events
Stars: ✭ 24 (+71.43%)
Mutual labels:  package, laravel-package
laravel-repoman
Set a payment deadline for the customer
Stars: ✭ 14 (+0%)
Mutual labels:  package, laravel-package
Laravel Natural Language
This package makes using the Google Natural API in your laravel app a breeze with minimum to no configuration, clean syntax and a consistent package API.
Stars: ✭ 119 (+750%)
Mutual labels:  package, laravel-package
Laravel Url Shortener
Powerful URL shortening tools in Laravel
Stars: ✭ 80 (+471.43%)
Mutual labels:  lumen, laravel-package
Laravel Source Encrypter
Laravel and Lumen Source Code Encrypter
Stars: ✭ 175 (+1150%)
Mutual labels:  lumen, laravel-package
Laravel Multilingual Routes
A package to handle multilingual routes in your Laravel application.
Stars: ✭ 241 (+1621.43%)
Mutual labels:  package, laravel-package
baserepo
Base repository
Stars: ✭ 71 (+407.14%)
Mutual labels:  lumen, lumen-package

Documentation

Let's go

Composer

composer require kosmosx/response

require __DIR__ . '/vendor/autoload.php';
$response = new Kosmosx\Response\RestResponse();

$handler = Kosmosx\Response\Exceptions\Handler();
$handler->setExceptionHandler();  

use it

$response = new Kosmosx\Response\RestResponse($content, $status, $headers); //constructor
$response = new Kosmosx\Response\Factory\FactoryResponse::success(); //factory

$response->withData(true); //add to json array with key 'data'

Example

$response->success()
         ->withData(['test' => true])
         ->withData(['test2' => false])
         ->withMessage('Microservice Lumen work')
         ->withState();

//response 				
{
    "data": {
        "test": true,
        "test2": false
    },
    "messages": "Microservice Lumen work",
    "state": "OK"
}

en: documentation

it: documentazione


If you find a bug or want to contribute, write to [email protected]

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].