PHPackages                             phl/laravel-respond-to - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. phl/laravel-respond-to

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

phl/laravel-respond-to
======================

Provide rails like respond\_to functionality to Laravel

2.1.0(4y ago)1575MITPHPPHP ^7.3|^8.0|^8.1CI failing

Since Apr 17Pushed 4y agoCompare

[ Source](https://github.com/paulhenri-l/laravel-respond-to)[ Packagist](https://packagist.org/packages/phl/laravel-respond-to)[ RSS](/packages/phl-laravel-respond-to/feed)WikiDiscussions main Synced 2mo ago

READMEChangelog (5)Dependencies (3)Versions (6)Used By (0)

Laravel RespondTo
=================

[](#laravel-respondto)

[![PHP Tests](https://github.com/paulhenri-l/laravel-respond-to/actions/workflows/php-tests.yml/badge.svg)](https://github.com/paulhenri-l/laravel-respond-to/actions/workflows/php-tests.yml)

This library will provide you with rails like `respond_to` functionality. This feature allows a controller action to return different responses according to the request `Accept` header (the format).

Installation
------------

[](#installation)

```
composer require phl/laravel-respond-to

```

Usage
-----

[](#usage)

You may use the respond to functionality in any of your controller action by using the `PHL\LaravelRespondTo\Respond` class.

```
