keljtanoski / modular-laravel
个人蓝图项目启动器。
v1.3.9
2023-02-06 20:06 UTC
Requires
- php: ^8.0.2
- fruitcake/laravel-cors: ^2.0.5
- guzzlehttp/guzzle: ^7.2
- laravel/framework: ^9.19
- laravel/sanctum: ^3.0
- laravel/tinker: ^2.7
Requires (Dev)
- barryvdh/laravel-ide-helper: ^2.10
- fakerphp/faker: ^1.9.1
- laravel/pint: ^1.0
- laravel/sail: ^1.15
- mockery/mockery: ^1.4.4
- nunomaduro/collision: ^6.1
- phpunit/phpunit: ^9.5.10
- roave/security-advisories: dev-latest
- spatie/laravel-ignition: ^1.0
- dev-main
- v1.3.9
- v1.3.8
- v1.3.7
- v1.3.6
- v1.3.5
- v1.3.4
- v1.3.3
- v1.3.2
- v1.3.1
- v1.3.0
- v1.2.0
- v1.1.10
- v1.1.9
- v1.1.8
- v1.1.7
- v1.1.6
- v1.1.5
- v1.1.4
- v1.1.3
- v1.1.2
- v1.1.1
- v1.1.0
- v1.0.17
- v1.0.16
- v1.0.15
- v1.0.14
- v1.0.13
- v1.0.12
- v1.0.11
- v1.0.10
- v1.0.9
- v1.0.8
- v1.0.7
- v1.0.6
- v1.0.5
- v1.0.4
- v1.0.3
- v1.0.2
- v1.0.1
- v1.0.0
- dev-add-modules-generator
- dev-develop
- dev-task/4-add-presenters
This package is auto-updated.
Last update: 2024-09-23 00:22:55 UTC
README
关于 Modular Laravel
此项目是一个具有自定义模块化/ SOA 架构的个人蓝图启动器。
安装
您可以使用 composer 创建新的 Modular Laravel 项目:
composer create-project keljtanoski/modular-laravel
项目创建后,运行以下命令:
composer install
然后生成应用密钥:
php artisan key:generate
然后创建存储链接:
php artisan storage:link
然后运行迁移:
php artisan migrate:fresh
Laravel Sail
此蓝图包含 Laravel Sail,默认配置包括 mysql
和 redis
,在 docker-composer.yml
文件中。您可以通过在终端运行 php artisan sail:install
并选择所需的配置来自定义设置或偏好。
要启动 Docker 容器,请运行:
./vendor/bin/sail up
这将拉取 Docker 镜像并启动容器。
或者,您可以通过以下命令在后台启动 Docker 容器:
./vendor/bin/sail up -d
当 Docker 容器启动并就绪后,您可以通过以下命令在 Docker 中运行迁移:
./vendor/bin/sail artisan migrate:fresh
然后运行示例模块的种子文件:
./vendor/bin/sail artisan db:seed
核心结构
app
├── Modules
│ └── Core
│ ├── Controllers
│ | ├── ApiController.php
| | └── Controller.php
│ ├── Exceptions
│ | ├── FormRequestTableNotFoundException.php
│ | ├── GeneralException.php
│ | ├── GeneralIndexException.php
│ | ├── GeneralSearchException.php
│ | ├── GeneralStoreException.php
│ | ├── GeneralNotFoundException.php
│ | ├── GeneralDestroyException.php
| | └── GeneralUpdateException.php
│ ├── Filters
│ | ├── QueryFilter.php
| | └── FilterBuilder.php
│ ├── Helpers
| | └── Helper.php
│ ├── Interfaces
│ | ├── FilterInterface.php
│ | ├── SearchInterface.php
| | └── RepositoryInterface.php
│ ├── Models
| | └── .gitkeep
│ ├── Repositories
| | └── Repository.php
│ ├── Requests
│ | ├── FormRequest.php
│ | ├── CreateFormRequest.php
│ | ├── DeleteFormRequest.php
│ | ├── SearchFormRequest.php
│ | ├── UpdateFormRequest.php
| | └── ShowFormRequest.php
│ ├── Resources
│ | └── .gitkeep
│ ├── Scopes
| | └── .gitkeep
│ ├── Traits
│ | ├── ApiResponses.php
| | └── Filterable.php
│ ├── Transformers
│ | ├── EmptyResource.php
| | └── EmptyResourceCollection.php
│ └──
└──
示例模块结构
app
├── Modules
│ └── Example
│ ├── Config
| | └── .gitkeep
│ ├── Controllers
│ │ ├── Api
│ │ │ └── ExamplesController.php
| | └── ExamplesController.php
│ ├── Exceptions
│ | ├── ExampleDestroyException.php
│ | ├── ExampleIndexException.php
│ | ├── ExampleNotFoundException.php
│ | ├── ExampleSearchException.php
│ | ├── ExampleStoreException.php
| | └── ExampleUpdateException.php
│ ├── Filters
│ | ├── ExampleType.php
│ | ├── ExampleTypeId.php
│ | ├── IsActive.php
| | └── Name.php
│ ├── Helpers
| | └── .gitkeep
│ ├── Interfaces
| | └── ExampleInterface.php
│ ├── Models
| | └── Example.php
│ ├── Repositories
| | └── ExampleRepository.php
│ ├── Requests
│ | ├── CreateExampleRequest.php
│ | ├── DeleteExampleRequest.php
│ | ├── SearchExampleRequest.php
│ | ├── ShowExampleRequest.php
| | └── UpdateExampleRequest.php
│ ├── Resources
│ | ├── lang
| | | └── .gitkeep
│ | └── views
| | ├── layouts
| | | └── master.blade.php
| | ├── index.blade.php
| | └── create.blade.php
│ ├── routes
│ | ├── api.php
| | └── web.php
│ ├── Services
| | └── ExampleService.php
│ ├── Traits
| | └── .gitkeep
│ ├── Transformers
| | └── ExampleResource.php
│ └──
└──
路由列表
+----------+---------------------------+---------------------------+------------------------------------------------------------------------+---------------+
| Method | URI | Name | Action | Middleware |
+----------+---------------------------+---------------------------+------------------------------------------------------------------------+---------------+
| POST | api/v1/example-types | api.example_types.store | App\Modules\ExampleType\Controllers\Api\ExampleTypesController@store | api |
| GET|HEAD | api/v1/example-types | api.example_types.index | App\Modules\ExampleType\Controllers\Api\ExampleTypesController@index | api |
| DELETE | api/v1/example-types/{id} | api.example_types.destroy | App\Modules\ExampleType\Controllers\Api\ExampleTypesController@destroy | api |
| PATCH | api/v1/example-types/{id} | api.example_types.update | App\Modules\ExampleType\Controllers\Api\ExampleTypesController@update | api |
| GET|HEAD | api/v1/example-types/{id} | api.example_types.show | App\Modules\ExampleType\Controllers\Api\ExampleTypesController@show | api |
| GET|HEAD | api/v1/examples | api.examples.index | App\Modules\Example\Controllers\Api\ExamplesController@index | api |
| POST | api/v1/examples | api.examples.store | App\Modules\Example\Controllers\Api\ExamplesController@store | api |
| GET|HEAD | api/v1/examples/{id} | api.examples.show | App\Modules\Example\Controllers\Api\ExamplesController@show | api |
| PATCH | api/v1/examples/{id} | api.examples.update | App\Modules\Example\Controllers\Api\ExamplesController@update | api |
| DELETE | api/v1/examples/{id} | api.examples.destroy | App\Modules\Example\Controllers\Api\ExamplesController@destroy | api |
| POST | example-types | example_types.store | App\Modules\ExampleType\Controllers\ExampleTypesController@store | web |
| GET|HEAD | example-types | example_types.index | App\Modules\ExampleType\Controllers\ExampleTypesController@index | web |
| GET|HEAD | example-types/create | example_types.create | App\Modules\ExampleType\Controllers\ExampleTypesController@create | web |
| GET|HEAD | example-types/{id} | example_types.show | App\Modules\ExampleType\Controllers\ExampleTypesController@show | web |
| PATCH | example-types/{id} | example_types.update | App\Modules\ExampleType\Controllers\ExampleTypesController@update | web |
| DELETE | example-types/{id} | example_types.destroy | App\Modules\ExampleType\Controllers\ExampleTypesController@destroy | web |
| GET|HEAD | example-types/{id}/edit | example_types.edit | App\Modules\ExampleType\Controllers\ExampleTypesController@edit | web |
| GET|HEAD | examples | examples.index | App\Modules\Example\Controllers\ExamplesController@index | web |
| POST | examples | examples.store | App\Modules\Example\Controllers\ExamplesController@store | web |
| GET|HEAD | examples/create | examples.create | App\Modules\Example\Controllers\ExamplesController@create | web |
| DELETE | examples/{id} | examples.destroy | App\Modules\Example\Controllers\ExamplesController@destroy | web |
| PATCH | examples/{id} | examples.update | App\Modules\Example\Controllers\ExamplesController@update | web |
| GET|HEAD | examples/{id} | examples.show | App\Modules\Example\Controllers\ExamplesController@show | web |
| GET|HEAD | examples/{id}/edit | examples.edit | App\Modules\Example\Controllers\ExamplesController@edit | web |
+----------+---------------------------+---------------------------+------------------------------------------------------------------------+---------------+
许可证
Laravel 框架是开源软件,采用 MIT 许可证。