承接 0x17/laravel-repository 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

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

0x17/laravel-repository

最新稳定版本:1.0

Composer 安装命令:

composer require 0x17/laravel-repository

包简介

This is a package that help to implement repository pattern in laravel

README 文档

README

This is a package that help to implement repository pattern in laravel

Installation

The first step is using composer to install the package and automatically update your composer.json file, you can do this by running:

  composer require 0x17/laravel-repository

Usage/Examples

create dto

  php artisan make:dto User

create service class

  php artisan make:service User

create repository class

  php artisan make:repository User

Register UserRepository:

<?php

namespace App\Providers;

use Illuminate\Support\ServiceProvider;
use App\Repositories\Interfaces\IUserRepository;
use App\Repositories\UserRepository;
use App\Models\User;

class AppServiceProvider extends ServiceProvider
{
    /**
     * Register any application services.
     */
    public function register(): void
    {
        $this->app->bind(IUserRepository::class, function () {
            return new UserRepository(new User());
        });
    }

    /**
     * Bootstrap any application services.
     */
    public function boot(): void
    {
        //
    }
}

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2023-06-24