Stars: 141
Forks: 20
Pull Requests: 735
Issues: 0
Watchers: 6
Last Updated: 2023-09-14 00:16:31
Laravel Application skeleton for me.
License: MIT License
Languages: PHP, Shell
开箱即用的 Laravel API 基础结构。
🚨自己用的哈,仅供参考,不提供咨询解答服务。
$ composer create-project overtrue/laravel-skeleton -vvv
$ cp .env.example .env
$ php artisan migrate --seed
这一步将会创建管理员账号
username:admin / password:changeThis!!
和一个 demo 设置项。
然后访问 http://laravel-skeleton.test/api/settings
将会看到演示的设置项信息。
php artisan make:domain Post
该命令将会创建
domain/Post
目录,包含Actions
,Models
,Policies
,Filters
等目录。
所有官方的生成命令都增加了 -d
参数,用于指定领域名称,例如:
php artisan make:model Post -d Post
另外,还有一些自定义的生成命令:
php artisan make:action MarkPostAsDraft -d Post
php artisan make:app Post
php artisan make:endpoint GetPost -a Post
php artisan make:middleware MustBePublished -a Post
php artisan make:request CreatePost -a Post
php artisan make:resource Post -a Post
application/json
){
"username": "admin",
"password": "changeThis!!"
}
{
"type": "bearer",
"token":"oVFV407i4jSTxjFO2tNxzh8lDaxVLbIkZZiDwjgMSYhvvkbUUXw8y0XgeYtxLAp4paznq0oxSMDdXmco"
}
application/json
){
"username": "demo",
"password": "123456"
}
application/json
){
"type": "bearer",
"token":"oVFV407i4jSTxjFO2tNxzh8lDaxVLbIkZZiDwjgMSYhvvkbUUXw8y0XgeYtxLAp4paznq0oxSMDdXmco"
}
application/json
)
+ HeadersAuthorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1...
application/json
)
+ HeadersAuthorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1...
application/json
){
"id": 1,
"username": "admin",
"nickname": "超级管理员",
"avatar": "\/img\/default-avatar.png",
"email": null,
"gender": "none",
"phone": null,
"birthday": null,
"settings": [],
"is_admin": true,
"last_active_at": null,
"last_refreshed_at": null,
"banned_at": null,
"email_verified_at": null,
"created_at": "2020-03-17T09:37:45.000000Z",
"updated_at": "2020-03-17T09:37:45.000000Z",
"deleted_at": null
}
If you like the work I do and want to support it, you know what to do ❤️
如果你喜欢我的项目并想支持它,点击这里 ❤️
Many thanks to Jetbrains for kindly providing a license for me to work on this and other open-source projects.
MIT