Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

Version 1 Next »

This How to describes how to implement AJAX into Laravel on the example of datatables

Step-by-step guide

Requirements:

  1. Postman ( https://www.getpostman.com )
  2. Route with disabled auth middleware (for development only!!)
  3. Controller Method which returns JSON

1. Setup Route

First create a Route in Routes or BaseRoute

This is the generic Route for the Datatables plugin,to generate a route for every Index-controller.

We handle all requests in the BaseController and get the data from Model

2. Setup Controller Method

In your desired Controller Method, make sure to return Response::json instead ov view::

3. Setup Postman Postman

Go into Builder Tab and Select your HTTP Request Type, your Route to your controller method and a Content-type Key with Value application/json (your Window should look similar to the picture below)

 

This is just a short Description. A real world example will be added

Filter by label

There are no items with the selected labels at this time.

  • No labels