Laravel Response Formatter

Overview

Project logo

Laravel Response Formatter

Status GitHub Issues GitHub Pull Requests License


I created this package to make it easier to format the response from a controller. I have used this package in my projects and I hope you enjoy it!


📝 Table of Contents

🧐 About

It is a simple package that allows you to format your response in a consistent way. This might be useful for your API, or for your front-end.

🏁 Getting Started

These instructions will help you get started with your project.

Prerequisites

What things you need to install the software and how to install them.

composer
Laravel Version: >= 5.8

Installing

A step by step series of examples that tell you how to get a development env running.

composer require antare74/response-formatter

🎈 Usage

Example Usage.

'Antare74', 'age' => '74', 'address' => 'Jakarta', ], 'Success Message'); }); Route::get('/error', function () { return Format::error([ 'my_error_data' => 'Error Message', ], 'Error Message', 500); }); ">
 'Antare74',
        'age' => '74',
        'address' => 'Jakarta',
    ], 'Success Message');
});

Route::get('/error', function () {
    return Format::error([
        'my_error_data' => 'Error Message',
    ], 'Error Message', 500);
});

Example Success Response.

{
  "meta": {
    "code": 200,
    "status": "success",
    "message": "Success Message",
    "is_paginated": false
  },
  "pagination": [
    
  ],
  "data": {
    "name": "Antare74",
    "age": "74",
    "address": "Jakarta"
  }
}

Example Error Response.

{
  "meta": {
    "code": 500,
    "status": "error",
    "message": "Error Message",
    "is_paginated": false
  },
  "data": {
    "my_error_data": "Error Message"
  }
}

✍️ Authors

See also the list of contributors who participated in this project.

🎉 Acknowledgements

You might also like...
A Magento Incident Response Plan Template

A Magento centric Incident Response Plan Template Introduction This will provide you with our defined process and procedures to use when responding to

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.

List of 77 languages for Laravel Framework 4, 5, 6, 7 and 8, Laravel Jetstream , Laravel Fortify, Laravel Breeze, Laravel Cashier, Laravel Nova and Laravel Spark.

Laravel Lang In this repository, you can find the lang files for the Laravel Framework 4/5/6/7/8, Laravel Jetstream , Laravel Fortify, Laravel Cashier

⚡ Laravel Charts — Build charts using laravel. The laravel adapter for Chartisan.
⚡ Laravel Charts — Build charts using laravel. The laravel adapter for Chartisan.

What is laravel charts? Charts is a Laravel library used to create Charts using Chartisan. Chartisan does already have a PHP adapter. However, this li

Laravel Kickstart is a Laravel starter configuration that helps you build Laravel websites faster.

Laravel Kickstart What is Laravel Kickstart? Laravel Kickstart is a Laravel starter configuration that helps you build Laravel websites faster. It com

Laravel User Activity Log - a package for Laravel 8.x that provides easy to use features to log the activities of the users of your Laravel app
Laravel User Activity Log - a package for Laravel 8.x that provides easy to use features to log the activities of the users of your Laravel app

Laravel User Activity Log - a package for Laravel 8.x that provides easy to use features to log the activities of the users of your Laravel app

Laravel Segment is an opinionated, approach to integrating Segment into your Laravel application.

Laravel Segment Laravel Segment is an opinionated, approach to integrating Segment into your Laravel application. Installation You can install the pac

Laravel Sanctum support for Laravel Lighthouse
Laravel Sanctum support for Laravel Lighthouse

Lighthouse Sanctum Add Laravel Sanctum support to Lighthouse Requirements Installation Usage Login Logout Register Email Verification Forgot Password

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

simple-response Simple package to handle response properly in your API. This package does not include any dependency. Install Via Composer $ composer

Phuong Danh 3 Dec 8, 2021
Tiny Laravel worldwide currency formatter

Laravel Currency Formatter Tiny Laravel worldwide currency formatter Install composer require magarrent/laravel-currency-formatter Usage use Magarrent

Marc Garcia Torrent 17 Oct 5, 2022
An opinionated blade template formatter for Laravel that respects readability

blade-formatter An opinionated blade template formatter for Laravel that respects readability Online Demo Features Automatically Indents markup inside

Shuhei Hayashibara 277 Dec 26, 2022
Easily capture every incoming request and the corresponding outgoing response in your Laravel app.

Easily capture every incoming request and the corresponding outgoing response in your Laravel app. This package is designed to work only with the Lara

Mark Townsend 22 Nov 15, 2022
This Package helps you in laravel application to log all desired activity for each request from request entry point to generate response at a single snapshot.

Laravel Scenario Logger This Package helps you in laravel application to log all desired activity for each request from request entry point to generat

Mehrdad Mahdian 6 Sep 27, 2021
Convert remote api response data into laravel model

laravel remote model Create remote driver to convert remote api request into laravel model. 中文文档 日本語文書 overview Install the version between laravel5.5

张子彬 15 Aug 11, 2022
A Laravel response helper methods.

A Laravel response helper methods. The package respond provides a fluent syntax to form array or json responses.

Najm Njeim 5 Nov 2, 2021
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

Obay Hamed 155 Dec 14, 2022
Provides a powerful error response system for Laravel

Laravel Exceptions Laravel Exceptions was created by, and is maintained by Graham Campbell, and provides a powerful error response system for both dev

Graham Campbell 571 Jan 31, 2022
Laravel Custom Response Messages from Passport Oauth2 Server

This is a sample repository showing how to install Oauth2 server using Laravel's passport package and customize its responses.

M. Ismail 7 Nov 22, 2022