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

add default axios

parent 634ce2d5
...@@ -15,8 +15,7 @@ class CreateUsersTable extends Migration ...@@ -15,8 +15,7 @@ class CreateUsersTable extends Migration
{ {
Schema::create('users', function (Blueprint $table) { Schema::create('users', function (Blueprint $table) {
$table->bigIncrements('id'); $table->bigIncrements('id');
$table->string('name'); $table->string('email', 100)->unique();
$table->string('email')->unique();
$table->timestamp('email_verified_at')->nullable(); $table->timestamp('email_verified_at')->nullable();
$table->string('password'); $table->string('password');
$table->rememberToken(); $table->rememberToken();
......
...@@ -14,7 +14,7 @@ class CreatePasswordResetsTable extends Migration ...@@ -14,7 +14,7 @@ class CreatePasswordResetsTable extends Migration
public function up() public function up()
{ {
Schema::create('password_resets', function (Blueprint $table) { Schema::create('password_resets', function (Blueprint $table) {
$table->string('email')->index(); $table->string('email', 100)->index();
$table->string('token'); $table->string('token');
$table->timestamp('created_at')->nullable(); $table->timestamp('created_at')->nullable();
}); });
......
This source diff could not be displayed because it is too large. You can view the blob instead.
window.Vue = require('vue'); 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 Vue from 'vue';
import Vuetify from 'vuetify'; import Vuetify from 'vuetify';
......
...@@ -3,20 +3,25 @@ ...@@ -3,20 +3,25 @@
<v-container grid-list-md text-xs-center> <v-container grid-list-md text-xs-center>
<p class="headline my-4">ลงชื่อเข้าใช้</p> <p class="headline my-4">ลงชื่อเข้าใช้</p>
<v-flex sm4 offset-sm4> <v-flex sm4 offset-sm4>
<v-text-field <v-form @submit.prevent="login()">
label="อีเมล" <v-text-field
prepend-inner-icon="email" label="อีเมล"
color="primary" prepend-inner-icon="email"
class="fix-size red--text" color="primary"
></v-text-field> class="fix-size red--text"
<v-text-field type="email"
label="รหัสผ่าน" v-model="user.email"
type="password" ></v-text-field>
color="primary" <v-text-field
prepend-inner-icon="lock" label="รหัสผ่าน"
></v-text-field> type="password"
<p class="text-xs-right"><a href="#" class="body-2 font-weight-medium">ลืมรหัสผ่าน?</a></p> color="primary"
<v-btn color="blue" block dark large>เข้าสู่ระบบ</v-btn> 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-layout row wrap align-center justify-center fill-height>
<v-flex sm5> <v-flex sm5>
<v-divider></v-divider> <v-divider></v-divider>
...@@ -42,6 +47,26 @@ ...@@ -42,6 +47,26 @@
</div> </div>
</template> </template>
<script>
export default {
data () {
return {
user: {
email: '',
password: ''
}
}
},
methods: {
login () {
console.log('login')
axios.post('/login', this.user)
}
}
}
</script>
<style lang="scss" scoped> <style lang="scss" scoped>
.fix-size { .fix-size {
height: 50px; 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