Skip to content

Instantly share code, notes, and snippets.

View omaralalwi's full-sized avatar

Omar Alalwi omaralalwi

View GitHub Profile
@omaralalwi
omaralalwi / Jquery Ajax
Created August 25, 2020 18:16 — forked from JonnyNineToes/Jquery Ajax
Quick template for Jquery Ajax calls
// submit is an action performed ON THE FORM ITSELF...
// probably best to give the form an ID attribute and refer to it by that
$('form').submit( function (event) {
// prevent the usual form submission behaviour; the "action" attribute of the form
event.preventDefault();
// validation goes below...
// now for the big event
$.ajax({
// the server script you want to send your data to

Steps

  1. Setup Laravel app
  2. Setup vue.js inside laravel app

Setup Laravel app

  • New Laravel app
  • Rename .env.example to .env
  • Config config/database.php to MySQL or SQLite
  • For SQLite, run touch storage/database.sqlite to create sqlite database