Skip to content

Commit 6023959

Browse files
committed
Init
0 parents  commit 6023959

File tree

325 files changed

+17792
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

325 files changed

+17792
-0
lines changed

.babelrc

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
{
2+
"presets": [
3+
["env", {
4+
"modules": false,
5+
"targets": {
6+
"browsers": ["> 1%", "last 2 versions", "not ie <= 8"]
7+
}
8+
}],
9+
"stage-2"
10+
],
11+
"plugins": ["transform-vue-jsx", "transform-runtime"],
12+
"env": {
13+
"development":{
14+
"plugins": ["dynamic-import-node"]
15+
}
16+
}
17+
}

.editorconfig

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
# http://editorconfig.org
2+
root = true
3+
4+
[*]
5+
charset = utf-8
6+
indent_style = space
7+
indent_size = 2
8+
end_of_line = lf
9+
insert_final_newline = true
10+
trim_trailing_whitespace = true
11+
12+
[*.md]
13+
insert_final_newline = false
14+
trim_trailing_whitespace = false

.env.example

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
APP_NAME=Laravel
2+
APP_ENV=local
3+
APP_KEY=
4+
APP_DEBUG=true
5+
APP_LOG_LEVEL=debug
6+
APP_URL=http://localhost
7+
8+
DB_CONNECTION=mysql
9+
DB_HOST=127.0.0.1
10+
DB_PORT=3306
11+
DB_DATABASE=homestead
12+
DB_USERNAME=homestead
13+
DB_PASSWORD=secret
14+
15+
BROADCAST_DRIVER=log
16+
CACHE_DRIVER=file
17+
SESSION_DRIVER=file
18+
QUEUE_DRIVER=sync
19+
20+
REDIS_HOST=127.0.0.1
21+
REDIS_PASSWORD=null
22+
REDIS_PORT=6379
23+
24+
MAIL_DRIVER=smtp
25+
MAIL_HOST=smtp.mailtrap.io
26+
MAIL_PORT=2525
27+
MAIL_USERNAME=null
28+
MAIL_PASSWORD=null
29+
MAIL_ENCRYPTION=null
30+
31+
PUSHER_APP_ID=
32+
PUSHER_APP_KEY=
33+
PUSHER_APP_SECRET=
34+
35+
# Swagger UI版本
36+
SWAGGER_VERSION=3.0
37+
38+
# dingo config
39+
API_STANDARDS_TREE=prs
40+
API_SUBTYPE=laravel
41+
API_PREFIX=api
42+
API_VERSION=v1
43+
API_DEBUG=false
44+

.eslintignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
webpack.mix.js
2+
public/*.js

.eslintrc.js

Lines changed: 195 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,195 @@
1+
module.exports = {
2+
root: true,
3+
parserOptions: {
4+
parser: 'babel-eslint',
5+
sourceType: 'module'
6+
},
7+
env: {
8+
browser: true,
9+
node: true,
10+
es6: true,
11+
},
12+
extends: ['plugin:vue/recommended', 'eslint:recommended'],
13+
14+
// add your custom rules here
15+
//it is base on https://github.com/vuejs/eslint-config-vue
16+
rules: {
17+
"vue/max-attributes-per-line": [2, {
18+
"singleline": 10,
19+
"multiline": {
20+
"max": 1,
21+
"allowFirstLine": false
22+
}
23+
}],
24+
"vue/name-property-casing": ["error", "PascalCase"],
25+
'accessor-pairs': 2,
26+
'arrow-spacing': [2, {
27+
'before': true,
28+
'after': true
29+
}],
30+
'block-spacing': [2, 'always'],
31+
'brace-style': [2, '1tbs', {
32+
'allowSingleLine': true
33+
}],
34+
'camelcase': [0, {
35+
'properties': 'always'
36+
}],
37+
'comma-dangle': [2, 'never'],
38+
'comma-spacing': [2, {
39+
'before': false,
40+
'after': true
41+
}],
42+
'comma-style': [2, 'last'],
43+
'constructor-super': 2,
44+
'curly': [2, 'multi-line'],
45+
'dot-location': [2, 'property'],
46+
'eol-last': 2,
47+
'eqeqeq': [2, 'allow-null'],
48+
'generator-star-spacing': [2, {
49+
'before': true,
50+
'after': true
51+
}],
52+
'handle-callback-err': [2, '^(err|error)$'],
53+
'indent': [2, 2, {
54+
'SwitchCase': 1
55+
}],
56+
'jsx-quotes': [2, 'prefer-single'],
57+
'key-spacing': [2, {
58+
'beforeColon': false,
59+
'afterColon': true
60+
}],
61+
'keyword-spacing': [2, {
62+
'before': true,
63+
'after': true
64+
}],
65+
'new-cap': [2, {
66+
'newIsCap': true,
67+
'capIsNew': false
68+
}],
69+
'new-parens': 2,
70+
'no-array-constructor': 2,
71+
'no-caller': 2,
72+
'no-console': 'off',
73+
'no-class-assign': 2,
74+
'no-cond-assign': 2,
75+
'no-const-assign': 2,
76+
'no-control-regex': 0,
77+
'no-delete-var': 2,
78+
'no-dupe-args': 2,
79+
'no-dupe-class-members': 2,
80+
'no-dupe-keys': 2,
81+
'no-duplicate-case': 2,
82+
'no-empty-character-class': 2,
83+
'no-empty-pattern': 2,
84+
'no-eval': 2,
85+
'no-ex-assign': 2,
86+
'no-extend-native': 2,
87+
'no-extra-bind': 2,
88+
'no-extra-boolean-cast': 2,
89+
'no-extra-parens': [2, 'functions'],
90+
'no-fallthrough': 2,
91+
'no-floating-decimal': 2,
92+
'no-func-assign': 2,
93+
'no-implied-eval': 2,
94+
'no-inner-declarations': [2, 'functions'],
95+
'no-invalid-regexp': 2,
96+
'no-irregular-whitespace': 2,
97+
'no-iterator': 2,
98+
'no-label-var': 2,
99+
'no-labels': [2, {
100+
'allowLoop': false,
101+
'allowSwitch': false
102+
}],
103+
'no-lone-blocks': 2,
104+
'no-mixed-spaces-and-tabs': 2,
105+
'no-multi-spaces': 2,
106+
'no-multi-str': 2,
107+
'no-multiple-empty-lines': [2, {
108+
'max': 1
109+
}],
110+
'no-native-reassign': 2,
111+
'no-negated-in-lhs': 2,
112+
'no-new-object': 2,
113+
'no-new-require': 2,
114+
'no-new-symbol': 2,
115+
'no-new-wrappers': 2,
116+
'no-obj-calls': 2,
117+
'no-octal': 2,
118+
'no-octal-escape': 2,
119+
'no-path-concat': 2,
120+
'no-proto': 2,
121+
'no-redeclare': 2,
122+
'no-regex-spaces': 2,
123+
'no-return-assign': [2, 'except-parens'],
124+
'no-self-assign': 2,
125+
'no-self-compare': 2,
126+
'no-sequences': 2,
127+
'no-shadow-restricted-names': 2,
128+
'no-spaced-func': 2,
129+
'no-sparse-arrays': 2,
130+
'no-this-before-super': 2,
131+
'no-throw-literal': 2,
132+
'no-trailing-spaces': 2,
133+
'no-undef': 2,
134+
'no-undef-init': 2,
135+
'no-unexpected-multiline': 2,
136+
'no-unmodified-loop-condition': 2,
137+
'no-unneeded-ternary': [2, {
138+
'defaultAssignment': false
139+
}],
140+
'no-unreachable': 2,
141+
'no-unsafe-finally': 2,
142+
'no-unused-vars': [2, {
143+
'vars': 'all',
144+
'args': 'none'
145+
}],
146+
'no-useless-call': 2,
147+
'no-useless-computed-key': 2,
148+
'no-useless-constructor': 2,
149+
'no-useless-escape': 0,
150+
'no-whitespace-before-property': 2,
151+
'no-with': 2,
152+
'one-var': [2, {
153+
'initialized': 'never'
154+
}],
155+
'operator-linebreak': [2, 'after', {
156+
'overrides': {
157+
'?': 'before',
158+
':': 'before'
159+
}
160+
}],
161+
'padded-blocks': [2, 'never'],
162+
'quotes': [2, 'single', {
163+
'avoidEscape': true,
164+
'allowTemplateLiterals': true
165+
}],
166+
'semi': [2, 'never'],
167+
'semi-spacing': [2, {
168+
'before': false,
169+
'after': true
170+
}],
171+
'space-before-blocks': [2, 'always'],
172+
'space-before-function-paren': [2, 'never'],
173+
'space-in-parens': [2, 'never'],
174+
'space-infix-ops': 2,
175+
'space-unary-ops': [2, {
176+
'words': true,
177+
'nonwords': false
178+
}],
179+
'spaced-comment': [2, 'always', {
180+
'markers': ['global', 'globals', 'eslint', 'eslint-disable', '*package', '!', ',']
181+
}],
182+
'template-curly-spacing': [2, 'never'],
183+
'use-isnan': 2,
184+
'valid-typeof': 2,
185+
'wrap-iife': [2, 'any'],
186+
'yield-star-spacing': [2, 'both'],
187+
'yoda': [2, 'never'],
188+
'prefer-const': 2,
189+
'no-debugger': process.env.NODE_ENV === 'production' ? 2 : 0,
190+
'object-curly-spacing': [2, 'always', {
191+
objectsInObjects: false
192+
}],
193+
'array-bracket-spacing': [2, 'never']
194+
}
195+
}

.gitattributes

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
* text=auto
2+
*.css linguist-vendored
3+
*.scss linguist-vendored
4+
*.js linguist-vendored
5+
CHANGELOG.md export-ignore

.gitignore

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
/node_modules
2+
/public/js
3+
/public/css
4+
/public/img
5+
/public/fonts
6+
/public/hot
7+
/public/storage
8+
/public/*.js
9+
/public/*.json
10+
/storage/*.key
11+
/vendor
12+
/.idea
13+
/.vagrant
14+
Homestead.json
15+
Homestead.yaml
16+
npm-debug.log
17+
yarn-error.log
18+
.env
19+
20+
composer.lock
21+
package-lock.json
22+
yarn.lock
23+
README.md

app/AdminLog.php

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
<?php
2+
3+
namespace App;
4+
5+
use Illuminate\Database\Eloquent\Model;
6+
7+
class AdminLog extends Model
8+
{
9+
//
10+
protected $table = 'admin_log';
11+
protected $guarded = [];
12+
}

app/Article.php

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
<?php
2+
3+
namespace App;
4+
5+
use Illuminate\Database\Eloquent\Model;
6+
7+
class Article extends Model
8+
{
9+
protected $guarded = [];
10+
protected $casts = [
11+
'category_id' => 'string',
12+
'user_id' => 'string'
13+
];
14+
15+
public function category(){
16+
return $this->belongsTo(Category::class);
17+
}
18+
19+
public function user(){
20+
return $this->belongsTo(User::class);
21+
}
22+
23+
public function scopePublished($q){
24+
return $q->where('status', 1);
25+
}
26+
}

app/Category.php

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
<?php
2+
3+
namespace App;
4+
5+
use Illuminate\Database\Eloquent\Model;
6+
7+
class Category extends Model
8+
{
9+
protected $table = 'categories';
10+
protected $fillable = ['name', 'slug'];
11+
12+
public function articles(){
13+
return $this->hasMany(Article::class, 'category_id', 'id');
14+
}
15+
16+
17+
}

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy