thunder-birds-studio/laravel-helpers 问题修复 & 功能扩展

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

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

thunder-birds-studio/laravel-helpers

Composer 安装命令:

composer require thunder-birds-studio/laravel-helpers

包简介

Helpers for laravel framework

README 文档

README

Helpers for laravel framework.

1. Helper fof(Class::class, $class_or_id) use for auto find the model using id or Model.

It may helper some reason. When use design pattern and you don't need it make a query every times when you pass data to your Services or Repositories. Or when you not sure you should pass Model or only id to other class.

class FooController
{
    /**
     * @var FooService
     */
    protected $foo_service;
    
    /**
     * @param FooService $foo_service
     */
    public function __construct(FooService $foo_service)
    {
        $this->foo_service = $foo_service;
    }
    
    /**
     * @param int $foo_id
     */
    public function bar($foo_id)
    {
        $this->foo_service->bar($foo_id);
    }
    
    /**
     * @param FooModel $foo
     */
    public function barz(FooModel $foo)
    {
        $this->foo_service->bar($foo);
    }
}
class FooService
{
    /**
     * @param FooModel|int $foo
     */
    public function bar($foo)
    {
        $foo = fof(FooModel::class, $foo);
        
        // Do somethings.
    }
}

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2018-07-04

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固