athmarios/yaml-response

YAML parser for Laravel 8.

Installs: 613

Dependents: 0

Suggesters: 0

Security: 0

Stars: 0

Watchers: 0

Forks: 2

pkg:composer/athmarios/yaml-response

v1.0.2 2021-03-08 19:47 UTC

This package is auto-updated.

Last update: 2025-10-09 06:13:56 UTC


README

GitHub license

This package will allow your application to determine whether the request wants a YAML response and then also respond with YAML. Made to work for laravel 8.

Install

You can pull in the package via composer:

$ composer require athmarios/yaml-response

Usage

See if the request wants a YAML response and then respond with YAML...

// app/Http/routes.php

use Illuminate\Http\Request;

Route::get('/some/route', function (Request $request) {
	// Was this a YAML request?
	if ($request->wantsYaml()) {
		// Then let's respond with YAML!
		response()->yaml(['This is my YAML response!']);
	}
});

License

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