shakib53626/laravel-repository-maker 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

shakib53626/laravel-repository-maker

Composer 安装命令:

composer require shakib53626/laravel-repository-maker

包简介

The shakib53626/laravel-repository-maker package provides a simple and efficient way to implement the Repository Design Pattern in Laravel projects. With a custom Artisan command (make:repository), developers can automatically generate repository classes with pre-defined methods like index, store, u

README 文档

README

License

The Laravel Repository Maker package provides a simple and efficient way to implement the Repository Design Pattern in Laravel projects. With a custom Artisan command (make:repository), developers can automatically generate repository classes with pre-defined methods like index, store, update, and delete.

This tool is designed to enhance modularity, promote clean architecture, and save development time.

Installation

You can install the package via Composer.

  1. Run composer require to require the package:
    composer require shakib53626/laravel-repository-maker:dev-master

Usage

Once the package is installed, you can use the custom Artisan command to generate repository classes.

To generate a new repository, run:

php artisan make:repository TestRepository

This command will create a UserRepository class in the app/Repositories directory with default methods.

Generated Repository Structure

The generated repository class will include the following methods:

  • index(): Logic for listing resources
  • store(): Logic for storing a new resource
  • show(): Logic for displaying a single resource
  • update(): Logic for updating a resource
  • delete(): Logic for soft-deleting a resource
  • trashList(): Logic for listing trashed resources
  • restore(): Logic for restoring a trashed resource
  • permanentDelete(): Logic for permanently deleting a resource

Configuration

This package doesn't require any configuration out of the box. However, you can customize the generated repository methods according to your needs.

License

This package is licensed under the MIT License. See the LICENSE file for more information.

Contributing

If you'd like to contribute to the package, feel free to fork the repository and submit a pull request.

  1. Fork the repository.
  2. Create a feature branch (git checkout -b feature/your-feature).
  3. Commit your changes (git commit -am 'Add new feature').
  4. Push to the branch (git push origin feature/your-feature).
  5. Create a new Pull Request.

Author

统计信息

  • 总下载量: 3
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 1
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 1
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2024-12-14