2017 © Pedro Peláez
 

library laravel-ajax-only-middleware

laravel middleware to allow ajax only calls

image

penance316/laravel-ajax-only-middleware

laravel middleware to allow ajax only calls

  • Wednesday, January 3, 2018
  • by penance316
  • Repository
  • 0 Watchers
  • 0 Stars
  • 843 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 2 Versions
  • 12 % Grown

The README.md

Laravel Ajax Only Middleware

Description

A small middleware that prevents routes being access unless via AJAX methods., (*1)

Install

composer require "penance316/laravel-ajax-only-middleware"

Register the middleware with you app in app/Http/Kernal.php, (*2)

  /**
    * The application's route middleware.
    *
    * @var array
    */
    protected $routeMiddleware = [
        //... existing code
        'ajax' => Penance316\Middleware\AjaxOnly::class,
    ];
}

Attach middleware to any routes you want to be accessible only via AJAX requests, (*3)

// File: routes.php
get('someitem/{id}', ['middleware' => 'ajax', 'uses' => 'SomeController@show']);

The Versions

03/01 2018

dev-master

9999999-dev

laravel middleware to allow ajax only calls

  Sources   Download

MIT

The Requires

  • php >=5.4.0

 

laravel middleware ajax

03/01 2018

v1.0

1.0.0.0

laravel middleware to allow ajax only calls

  Sources   Download

MIT

The Requires

  • php >=5.4.0

 

laravel middleware ajax