Store CSRF token in layout view that's accessible by Vue components
MODIFY
resources/assets/js/components/TransactionWizard.vue
resources/assets/js/components/TransactionWizard.vue
let errors = []
axios.post('/' + this.type + 's', {
- _token: 'hyeEjdASx1ihMrKLW0AUKgJ8jEokfX3goLsi6Mp5',
+ _token: document.querySelector('meta[name="csrf-token"]').getAttribute('content'),
date: this.date,
description: this.description,
amount: this.amount

MODIFY
resources/views/layout.blade.php
resources/views/layout.blade.php
<head>
<title>{{ View::hasSection('title') ? View::getSection('title') . ' - ' . config('app.name') : config('app.name') }}</title>
<meta name="viewport" content="width=device-width, initial-scale=1" />
+ <meta name="csrf-token" content="{{ csrf_token() }}" />
<script src="/storage/fontawesome/all.min.js"></script>
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Muli:400,400i,600,600i" />
<link rel="stylesheet" href="/css/app.css" />

Store CSRF token in layout view that's accessible by Vue components