ensue/snap
最新稳定版本:v1.3.0
Composer 安装命令:
composer require ensue/snap
包简介
Modular architecture build on top of laravel for any laravel project
README 文档
README
Snap System is the underlying architecture for Laravel projects, providing essential functionalities and features.
Getting Started
Install package
Install the package using Composer. Run the following command:
composer require ensue/snap
Prerequisites
| Package | Minimum Version |
|---|---|
| Laravel | 10 |
| php | 8.2 |
Exception handler
In your Handler.php located at app/Exceptions/Handler.php, follow these steps:
- Remove all existing code within the file.
- Extend class with SnapExceptionHandler
- Override any methods as needed.
Publish Config and Language Files (Optional)
You have the option to publish the configuration and language files. Use the following command:
php artisan vendor:publish --tag=snap
Generate module
To generate a module, run the following command:
php artisan snap:generate <module-name>
Make sure to replace with the actual name of the module you want to generate.
Extend Model
Extend your model from the SnapAppModel class to inherit additional functionalities.
Module structure
app
├── Modules
│ └── <module-name>
│ ├── Controllers
│ │ └── <module-name>Controller.php
│ ├── Database
│ │ └── Models
│ │ └── <module-name>.php
│ ├── Exceptions
│ ├── Filters
│ │ └── <module-name>Filter.php
│ ├── Interfaces
│ │ └── <module-name>Interface.php
│ ├── Middlewares
│ ├── Providers
│ ├── Repositories
│ │ └── <module-name>Repository.php
│ ├── Requests
│ │ ├── <module-name>CreateRequest.php
│ │ └── <module-name>UpdateRequest.php
│ ├── Routes
│ │ ├── api.php
│ │ └── web.php
│ ├── Views
│ └── ServiceProvider.php
└── System
└── <module-name>
└── Database
├── Exceptions
├── Models
│ └── <module-name>.php
└── Traits
Feel free to customize and expand upon the provided instructions as needed for your project. If you encounter any issues or need further assistance, please don't hesitate to contact us.
Contributing
Feel free to contribute :)
统计信息
- 总下载量: 457
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2023-08-28