PHP Simple Response, XML, JSON,... auto response with accept in request's header

Overview

simple-response

Software License Total Downloads

Simple package to handle response properly in your API. This package does not include any dependency.

Install

Via Composer

$ composer require phuongdanh/simple-response

Requirements

The following versions of PHP are supported by this version.

  • PHP 5.6
  • PHP 7.0
  • PHP 7.1
  • PHP 7.2
  • PHP 8.x

How to use it?

// Use namespace 
use SimpleResponse\Response;

// response with default data type based on Accept value in request's header
return Response::default($your_data);

// response as application/json
return Response::json($your_data);

// response as text/xml
return Response::xml($your_data);

License

The MIT License (MIT). Please see License File for more information.

You might also like...
A system for auto-decorating models with presenters
A system for auto-decorating models with presenters

Laravel Auto Presenter 7 This package automatically decorates objects bound to views during the view render process. Features Automatically decorate o

Simple and ready to use API response wrapper for Laravel.
Simple and ready to use API response wrapper for Laravel.

Laravel API Response Simple Laravel API response wrapper. Installation Install the package through composer: $ composer require obiefy/api-response Re

Simple PSR-7 compatible response sender

Simple PSR-7 compatible response sender

Simple package to handle response properly in your API.

Simple package to handle response properly in your API. This package uses Fractal and is based on Build APIs You Won't Hate book.

Dashboard to view your http client requests in laravel application
Dashboard to view your http client requests in laravel application

Laravel Blanket is a package with wraps laravel http client requests and provide logs for request and response, also give option to retry any request from dashboard and more...

This package provides convenient methods for making token code, sending and verifying mobile phone verification requests.
This package provides convenient methods for making token code, sending and verifying mobile phone verification requests.

Laravel Mobile Verification Introduction Many web applications require users to verify their mobile phone numbers before using the application. Rather

Make requests to the Shopify API from your Laravel app
Make requests to the Shopify API from your Laravel app

Make requests to the Shopify API from your Laravel app The signifly/laravel-shopify package allows you to easily make requests to the Shopify API. Ins

Log requests and group together for aggregated statistics of route usage
Log requests and group together for aggregated statistics of route usage

Log Laravel route usage statistics Log Laravel requests and responses for statistical purposes and optionally aggregate by hours/days/months for minim

Laravel magical helpers such as Controllers / Requests / Models

Laravel Magic provides Abstract Controller, Model, generic Request, Traits, Exceptions and various middlewares in order to generate very easily and quickly API resources from scratch.

Releases(v1.1.1)
Owner
Phuong Danh
Phuong Danh
Learn how to accept a payment from customers around the world with a variety of payment methods.

Accept a payment Learn how to securely accept payments online. This repository includes examples of 2 types of integration types. Prebuilt Checkout pa

Stripe Samples 337 Jan 2, 2023
Add Server-Timing header information from within your Laravel apps.

Laravel Server Timings Add Server-Timing header information from within your Laravel apps. Installation You can install the package via composer: comp

Beyond Code 498 Dec 15, 2022
🕵🏻‍♂️  The easiest way to respect the "do not track" header in Laravel

trackable The easiest way to respect the "do not track" header in Laravel Installation composer require s360digital/trackable API Trackable will expos

s360 2 Oct 7, 2022
Plugin for Filament Admin that adds a dropdown menu to the header to quickly create new items.

Filament Quick Create Plugin for Filament Admin that adds a dropdown menu to the header to quickly create new items from any page. Installation Instal

Adam Weston 45 Dec 27, 2022
Build XML based USSD menus.

Instead of having tonnes of nested, complex PHP files, this package give you the ability to construct your menus in XML and execute them as though they were plain PHP files.

Brian Matovu 6 Oct 6, 2022
Auto generate routes for Laravel Livewire components

livewire-auto-routes Auto generate routes for Laravel Livewire Components. Requirements Livewire 2 Laravel 8 php 8 Installation composer require tanth

Tina Hammar 19 May 11, 2022
Use auto generated UUID slugs to identify and retrieve your Eloquent models.

Laravel Eloquent UUID slug Summary About Features Requirements Installation Examples Compatibility table Alternatives Tests About By default, when get

Khalyomede 25 Dec 14, 2022
Auto Generate laravel api Documentation

Laravel Dark Documentation Generator ?? You can create Documentation for your api easily by using this library Installation: Require this package with

HusseinAlaa 6 May 8, 2022
Auto-generated Interface and Repository file via Repository pattern in Laravel

Auto-generated Repository Pattern in Laravel A repository is a separation between a domain and a persistent layer. The repository provides a collectio

Ngo Dinh Cuong 11 Aug 15, 2022
Laravel and Lumen Auto Hard Deleter

Laravel Auto Hard Deleter This package deletes soft deleted rows automatically after a time interval that you define. For Laravel and Lumen 6, 7, 8 In

Siavash Bamshadnia 38 Dec 28, 2022