Skip to content

Commit

Permalink
完善 Readme
Browse files Browse the repository at this point in the history
  • Loading branch information
hwbrzzl committed Oct 3, 2018
1 parent cbd9dd9 commit cda0be1
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 30 deletions.
27 changes: 5 additions & 22 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,22 +1,5 @@
vendor/
node_modules/
npm-debug.log

# Laravel 4 specific
bootstrap/compiled.php
app/storage/

# Laravel 5 & Lumen specific
public/storage
public/hot
storage/*.key
.env.*.php
.env.php
.env
Homestead.yaml
Homestead.json

# Rocketeer PHP task runner and deployment package. https://github.com/rocketeers/rocketeer
.rocketeer/

.idea
/vendor
*.log
composer.lock
/*_backup/
.idea/*
10 changes: 8 additions & 2 deletions Readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ php artisan make:graphql:column TestColumn --table=test --force
在 folklore/graphql 包的原命令基础上,增加了 「--table=」 参数,可以根据表生成对应字段,当 Type 类型文件中的字段不需要复用时,可以使用这个命令快速根据表生成字段。

```php
php artisan make:graphql:type TestType --table=Test
php artisan make:graphql:type TestType --table=test --force
```

## 用法
Expand Down Expand Up @@ -131,23 +131,29 @@ Column::make(TestColumn::class)
只保留 TestColumn 中的 id 字段。

```php
//支持字符串与数组
Column::make(TestColumn::class, true)->only(['id'])
Column::make(TestColumn::class, true)->only('id')
```

#### except

排除 TestColumn 中的 id 字段。

```php
//支持字符串与数组
Column::make(TestColumn::class, true)->except(['id'])
Column::make(TestColumn::class, true)->except('id')
```

#### nonNull

将 TestColumn 中的 某些字段设置为 Type::nonNull,支持 字符串 与 数组
将 TestColumn 中的 某些字段设置为 Type::nonNull。

```php
//支持字符串与数组
Column::make(TestColumn::class, true)->nonNull(['title'])
Column::make(TestColumn::class, true)->nonNull('title')
```

#### result
Expand Down
11 changes: 5 additions & 6 deletions composer.json
Original file line number Diff line number Diff line change
@@ -1,26 +1,25 @@
{
"name": "bowens-h/laravel-graphql-extend",
"description": "A extend for Folkloreatelier/laravel-graphql.",
"description": "Folkloreatelier/laravel-graphql 包的功能扩展。",
"license": "MIT",
"keywords": [
"laravel",
"search",
"database"
"graphql"
],
"authors": [
{
"name": "bowens-h",
"email": "hwbrzzl@qq.com"
"email": "hwbrzzl@gmail.com"
}
],
"require": {
"php": ">=5.5.9",
"illuminate/support": "5.1.*|5.2.*|5.3.*|5.4.*|5.5.*|5.6.*|5.7.*",
"folklore/graphql": "1.0.*|1.1.*",
"doctrine/dbal": "^2.8"
"doctrine/dbal": "2.5.*|2.6.*|2.7.*|2.8.*"
},
"require-dev": {
"phpunit/phpunit": "~4.0|~5.0|~5.7|~6.0"
"phpunit/phpunit": "~4.0|~5.0|~5.7|~6.0|~7.0"
},
"autoload": {
"psr-4": {
Expand Down

0 comments on commit cda0be1

Please sign in to comment.