Skip to content

Commit 47aa861

Browse files
committed
initial commit
1 parent 06373f0 commit 47aa861

40 files changed

+2967
-399
lines changed

Diff for: app/Http/Controllers/HomeController.php

+1-16
Original file line numberDiff line numberDiff line change
@@ -6,22 +6,7 @@
66

77
class HomeController extends Controller
88
{
9-
/**
10-
* Create a new controller instance.
11-
*
12-
* @return void
13-
*/
14-
public function __construct()
15-
{
16-
$this->middleware('auth');
17-
}
18-
19-
/**
20-
* Show the application dashboard.
21-
*
22-
* @return \Illuminate\Contracts\Support\Renderable
23-
*/
24-
public function index()
9+
public function __invoke()
2510
{
2611
return view('home');
2712
}

Diff for: package-lock.json

+1,628-211
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Diff for: package.json

+42-14
Original file line numberDiff line numberDiff line change
@@ -5,22 +5,50 @@
55
"development": "cross-env NODE_ENV=development node_modules/webpack/bin/webpack.js --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js",
66
"watch": "npm run development -- --watch",
77
"watch-poll": "npm run watch -- --watch-poll",
8-
"hot": "cross-env NODE_ENV=development node_modules/webpack-dev-server/bin/webpack-dev-server.js --inline --hot --config=node_modules/laravel-mix/setup/webpack.config.js",
8+
"hot": "cross-env NODE_ENV=development node_modules/webpack-dev-server/bin/webpack-dev-server.js --inline --hot --disable-host-check --config=node_modules/laravel-mix/setup/webpack.config.js",
99
"prod": "npm run production",
10-
"production": "cross-env NODE_ENV=production node_modules/webpack/bin/webpack.js --no-progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js"
10+
"production": "cross-env NODE_ENV=production node_modules/webpack/bin/webpack.js --no-progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js",
11+
"lint": "eslint --fix --ext .js,.vue resources/js"
12+
},
13+
"dependencies": {
14+
"@fortawesome/fontawesome-svg-core": "^1.2.32",
15+
"@fortawesome/free-brands-svg-icons": "^5.15.1",
16+
"@fortawesome/free-regular-svg-icons": "^5.15.1",
17+
"@fortawesome/free-solid-svg-icons": "^5.15.1",
18+
"@fortawesome/vue-fontawesome": "^2.0.0",
19+
"axios": "^0.21.0",
20+
"bootstrap": "^4.5.3",
21+
"bootstrap-vue": "^2.19.0",
22+
"jquery": "^3.5.1",
23+
"js-cookie": "^2.2.1",
24+
"popper.js": "^1.16.1",
25+
"sweetalert2": "^10.9.0",
26+
"vform": "^1.0.1",
27+
"vue": "^2.6.12",
28+
"vue-meta": "^2.4.0",
29+
"vue-router": "^3.4.8",
30+
"vuex": "^3.5.1",
31+
"vuex-router-sync": "^5.0.0"
1132
},
1233
"devDependencies": {
13-
"axios": "^0.19",
14-
"bootstrap": "^4.0.0",
15-
"cross-env": "^7.0",
16-
"jquery": "^3.2",
17-
"laravel-mix": "^5.0.1",
18-
"lodash": "^4.17.13",
19-
"popper.js": "^1.12",
20-
"resolve-url-loader": "^2.3.1",
21-
"sass": "^1.20.1",
22-
"sass-loader": "^8.0.0",
23-
"vue": "^2.5.17",
24-
"vue-template-compiler": "^2.6.10"
34+
"@babel/core": "^7.12.3",
35+
"@babel/eslint-parser": "^7.12.1",
36+
"@babel/plugin-syntax-dynamic-import": "^7.8.3",
37+
"@babel/preset-env": "^7.12.1",
38+
"cross-env": "^7.0.2",
39+
"eslint": "^7.12.1",
40+
"eslint-config-standard": "^16.0.1",
41+
"eslint-plugin-import": "^2.22.1",
42+
"eslint-plugin-node": "^11.1.0",
43+
"eslint-plugin-promise": "^4.2.1",
44+
"eslint-plugin-standard": "^4.0.2",
45+
"eslint-plugin-vue": "^7.1.0",
46+
"laravel-mix": "^5.0.7",
47+
"laravel-mix-versionhash": "^1.1.7",
48+
"resolve-url-loader": "^3.1.2",
49+
"sass": "^1.28.0",
50+
"sass-loader": "^10.0.4",
51+
"vue-template-compiler": "^2.6.12",
52+
"webpack-bundle-analyzer": "^3.9.0"
2553
}
2654
}

Diff for: resources/js/app.js

+13-29
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,16 @@
1-
/**
2-
* First we will load all of this project's JavaScript dependencies which
3-
* includes Vue and other libraries. It is a great starting point when
4-
* building robust, powerful web applications using Vue and Laravel.
5-
*/
1+
import Vue from 'vue'
2+
import store from '~/store'
3+
import router from '~/router'
4+
import App from '~/components/App'
65

7-
require('./bootstrap');
6+
import '~/plugins'
7+
import '~/components'
88

9-
window.Vue = require('vue');
9+
Vue.config.productionTip = false
1010

11-
/**
12-
* The following block of code may be used to automatically register your
13-
* Vue components. It will recursively scan this directory for the Vue
14-
* components and automatically register them with their "basename".
15-
*
16-
* Eg. ./components/ExampleComponent.vue -> <example-component></example-component>
17-
*/
18-
19-
// const files = require.context('./', true, /\.vue$/i)
20-
// files.keys().map(key => Vue.component(key.split('/').pop().split('.')[0], files(key).default))
21-
22-
Vue.component('example-component', require('./components/ExampleComponent.vue').default);
23-
24-
/**
25-
* Next, we will create a fresh Vue application instance and attach it to
26-
* the page. Then, you may begin adding components to this application
27-
* or customize the JavaScript scaffolding to fit your unique needs.
28-
*/
29-
30-
const app = new Vue({
31-
el: '#app',
32-
});
11+
/* eslint-disable no-new */
12+
new Vue({
13+
store,
14+
router,
15+
...App
16+
})

Diff for: resources/js/bootstrap.js

-41
This file was deleted.

Diff for: resources/js/components/App.vue

+66
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
<template>
2+
<div id="app">
3+
<loading ref="loading" />
4+
5+
<transition name="page" mode="out-in">
6+
<component :is="layout" v-if="layout" />
7+
</transition>
8+
</div>
9+
</template>
10+
11+
<script>
12+
import Loading from './Loading'
13+
14+
// Load layout components dynamically.
15+
const requireContext = require.context('~/layouts', false, /.*\.vue$/)
16+
17+
const layouts = requireContext.keys()
18+
.map(file =>
19+
[file.replace(/(^.\/)|(\.vue$)/g, ''), requireContext(file)]
20+
)
21+
.reduce((components, [name, component]) => {
22+
components[name] = component.default || component
23+
return components
24+
}, {})
25+
26+
export default {
27+
el: '#app',
28+
29+
components: {
30+
Loading
31+
},
32+
33+
data: () => ({
34+
layout: null,
35+
defaultLayout: 'default'
36+
}),
37+
38+
metaInfo () {
39+
const { appName } = window.config
40+
41+
return {
42+
title: appName,
43+
titleTemplate: `%s · ${appName}`
44+
}
45+
},
46+
47+
mounted () {
48+
this.$loading = this.$refs.loading
49+
},
50+
51+
methods: {
52+
/**
53+
* Set the application layout.
54+
*
55+
* @param {String} layout
56+
*/
57+
setLayout (layout) {
58+
if (!layout || !layouts[layout]) {
59+
layout = this.defaultLayout
60+
}
61+
62+
this.layout = layouts[layout]
63+
}
64+
}
65+
}
66+
</script>

Diff for: resources/js/components/Button.vue

+44
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
<template>
2+
<button :type="nativeType" :disabled="loading" :class="{
3+
[`btn-${type}`]: true,
4+
'btn-block': block,
5+
'btn-lg': large,
6+
'btn-loading': loading
7+
}" class="btn"
8+
>
9+
<slot />
10+
</button>
11+
</template>
12+
13+
<script>
14+
export default {
15+
name: 'VButton',
16+
17+
props: {
18+
type: {
19+
type: String,
20+
default: 'primary'
21+
},
22+
23+
nativeType: {
24+
type: String,
25+
default: 'submit'
26+
},
27+
28+
loading: {
29+
type: Boolean,
30+
default: false
31+
},
32+
33+
block: {
34+
type: Boolean,
35+
default: false
36+
},
37+
38+
large: {
39+
type: Boolean,
40+
default: false
41+
}
42+
}
43+
}
44+
</script>

Diff for: resources/js/components/Card.vue

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
<template>
2+
<div class="card">
3+
<div v-if="title" class="card-header">
4+
{{ title }}
5+
</div>
6+
7+
<div class="card-body">
8+
<slot />
9+
</div>
10+
</div>
11+
</template>
12+
13+
<script>
14+
export default {
15+
name: 'Card',
16+
17+
props: {
18+
title: { type: String, default: null }
19+
}
20+
}
21+
</script>

Diff for: resources/js/components/Checkbox.vue

+66
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
<template>
2+
<div class="custom-control custom-checkbox d-flex">
3+
<input
4+
:id="id || name"
5+
:name="name"
6+
:checked="internalValue"
7+
type="checkbox"
8+
class="custom-control-input"
9+
@click="handleClick"
10+
>
11+
<label :for="id || name" class="custom-control-label my-auto">
12+
<slot />
13+
</label>
14+
</div>
15+
</template>
16+
17+
<script>
18+
export default {
19+
name: 'Checkbox',
20+
21+
props: {
22+
id: { type: String, default: null },
23+
name: { type: String, default: 'checkbox' },
24+
value: { type: Boolean, default: false },
25+
checked: { type: Boolean, default: false }
26+
},
27+
28+
data: () => ({
29+
internalValue: false
30+
}),
31+
32+
watch: {
33+
value (val) {
34+
this.internalValue = val
35+
},
36+
37+
checked (val) {
38+
this.internalValue = val
39+
},
40+
41+
internalValue (val, oldVal) {
42+
if (val !== oldVal) {
43+
this.$emit('input', val)
44+
}
45+
}
46+
},
47+
48+
created () {
49+
this.internalValue = this.value
50+
51+
if ('checked' in this.$options.propsData) {
52+
this.internalValue = this.checked
53+
}
54+
},
55+
56+
methods: {
57+
handleClick (e) {
58+
this.$emit('click', e)
59+
60+
if (!e.isPropagationStopped) {
61+
this.internalValue = e.target.checked
62+
}
63+
}
64+
}
65+
}
66+
</script>

Diff for: resources/js/components/Child.vue

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
<template>
2+
<transition name="page" mode="out-in">
3+
<slot>
4+
<router-view />
5+
</slot>
6+
</transition>
7+
</template>
8+
9+
<script>
10+
export default {
11+
name: 'Child'
12+
}
13+
</script>

0 commit comments

Comments
 (0)