Skip to content

Instantly share code, notes, and snippets.

View cowboymathu's full-sized avatar

Mathuvathanan Mounasamy cowboymathu

  • Randers, Denmark
View GitHub Profile
@cowboymathu
cowboymathu / 1-add-middleware.php
Created February 15, 2018 22:14 — forked from adamwathan/1-add-macros.php
Multiformat Endpoints in Laravel
<?php
namespace App\Http\Middleware;
class CaptureRequestExtension
{
public function handle($request, $next)
{
if ($request->route()->parameter('_extension') !== null) {
$request->attributes->set('_extension', substr($request->route()->parameter('_extension'), 1));