Skip to content

修正安全提示並補完說明文件 #2

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Jul 17, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
root = true

[*]
charset = utf-8
end_of_line = lf
insert_final_newline = true
indent_style = space
indent_size = 4
trim_trailing_whitespace = true

[*.md]
trim_trailing_whitespace = false

[*.{yml,yaml}]
indent_size = 2
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
/vendor
/coverage
.env
.php_cs.cache
.phpunit.result.cache
composer.lock
28 changes: 27 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1 +1,27 @@
# A Laravel package example
# A2Workspace/Laravel-Stubs

一個基於專案的程式模板注入器。

透過在專案中的 `resources/stubs` 目錄下,放置類別的模板文件,然後透過命令快速注入並生成。相比原生的 `artisan make:*` 命令可大大減少編寫時間,且模板檔案可隨版控被 git 紀錄。

目前支援的類別類型:
- 命名空間 App\\* 開頭的類別
- 命名空間 Tests\\* 開頭的類別
- 命名空間 Database\\* 開頭的類別

## Installation | 安裝

此套件尚未發布到 **Packagist** 需透過下列方法安裝:

```
composer config repositories.a2workspace/laravel-stubs vcs https://github.com/A2Workspace/laravel-stubs.git
composer require "a2workspace/laravel-stubs:*"
```

## Usage | 如何使用

現在你可以使用 `make:a..` [Artisan 命令](https://laravel.com/docs/9.x/artisan)來生成類別。該命令將會讀取 `resources/stubs` 下的目錄或 `.php` 檔案,將佔位符依照格式替換為給定的名稱,並依照類別名稱自動生成檔案到相對的路徑。

```
php artisan make:a..
```
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "a2workspace/laravel-stubs",
"description": "A Laravel package example.",
"description": "一個基於專案的類別模板注入器。",
"license": "MIT",
"authors": [
{
Expand Down
Loading