Laravel 5: Create record using jQuery & ajax

The controller:

  1. We include our Office model
  2. We create the necessary functions.
  3. index function will be our only view, so that we won’t need a create.blade anymore.
  4. Our store function that will save our new records, then we return it in json format.

Sharing is caring!