Commit 005f3ca5 authored by Kittisak Maneewong's avatar Kittisak Maneewong

add default axios

parent 634ce2d5
......@@ -15,8 +15,7 @@ class CreateUsersTable extends Migration
{
Schema::create('users', function (Blueprint $table) {
$table->bigIncrements('id');
$table->string('name');
$table->string('email')->unique();
$table->string('email', 100)->unique();
$table->timestamp('email_verified_at')->nullable();
$table->string('password');
$table->rememberToken();
......
......@@ -14,7 +14,7 @@ class CreatePasswordResetsTable extends Migration
public function up()
{
Schema::create('password_resets', function (Blueprint $table) {
$table->string('email')->index();
$table->string('email', 100)->index();
$table->string('token');
$table->timestamp('created_at')->nullable();
});
......
This diff is collapsed.
window.Vue = require('vue');
window._ = require('lodash');
window.axios = require('axios');
window.axios.defaults.headers.common['X-Requested-With'] = 'XMLHttpRequest';
let token = document.head.querySelector('meta[name="csrf-token"]');
if (token) {
window.axios.defaults.headers.common['X-CSRF-TOKEN'] = token.content;
} else {
console.error('CSRF token not found: https://laravel.com/docs/csrf#csrf-x-csrf-token');
}
import Vue from 'vue';
import Vuetify from 'vuetify';
......
......@@ -3,20 +3,25 @@
<v-container grid-list-md text-xs-center>
<p class="headline my-4">ลงชื่อเข้าใช้</p>
<v-flex sm4 offset-sm4>
<v-text-field
label="อีเมล"
prepend-inner-icon="email"
color="primary"
class="fix-size red--text"
></v-text-field>
<v-text-field
label="รหัสผ่าน"
type="password"
color="primary"
prepend-inner-icon="lock"
></v-text-field>
<p class="text-xs-right"><a href="#" class="body-2 font-weight-medium">ลืมรหัสผ่าน?</a></p>
<v-btn color="blue" block dark large>เข้าสู่ระบบ</v-btn>
<v-form @submit.prevent="login()">
<v-text-field
label="อีเมล"
prepend-inner-icon="email"
color="primary"
class="fix-size red--text"
type="email"
v-model="user.email"
></v-text-field>
<v-text-field
label="รหัสผ่าน"
type="password"
color="primary"
prepend-inner-icon="lock"
v-model="user.password"
></v-text-field>
<p class="text-xs-right"><a href="#" class="body-2 font-weight-medium">ลืมรหัสผ่าน?</a></p>
<v-btn color="blue" block dark large type="submit">เข้าสู่ระบบ</v-btn>
</v-form>
<v-layout row wrap align-center justify-center fill-height>
<v-flex sm5>
<v-divider></v-divider>
......@@ -42,6 +47,26 @@
</div>
</template>
<script>
export default {
data () {
return {
user: {
email: '',
password: ''
}
}
},
methods: {
login () {
console.log('login')
axios.post('/login', this.user)
}
}
}
</script>
<style lang="scss" scoped>
.fix-size {
height: 50px;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment