定制 squadron-api/base 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

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

squadron-api/base

Composer 安装命令:

composer require squadron-api/base

包简介

Base Squadron package

README 文档

README

WIP (!!!)

Scrutinizer Code Quality Build Status Style CI

squadron/base

This is base package for Squadron API. Provides:

  • Integration with Sentry
  • UUIDs for models from the box
  • Some useful artisan commands
  • Helpers for other Squadron packages

Routes

  • /api/ping - simple application's ping, returns application version from .env

####Artisan commands

  • squadron:utils:hash {value : The string that will be hashed} - gets hash of the string
  • squadron:version:set - sets version in .env from last commit

BaseModel

\Squadron\Base\Models\BaseModel

Package contains abstract class for models in Squadron with some benefits:

  • UUID for primary key
  • table auto-locate by naming convention (model ThisIsCustomEntity -> table this_is_custom_entity)
  • default TIMESTAMP properties renamed to createdAt / updatedAt (trying to use CamelCase used all over app)

BaseController

\Squadron\Base\Http\Controllers\BaseController

This class is analogue of \App\Http\Contollers\Controller from fresh laravel's install with "traits initialization" support. Traits initialization for controllers works as Eloquent models initialization + auto-injects dependencies in initialize* methods.

Here is an example below:

use Illuminate\Http\Request;

trait ControllerTrait
{
    // Controller trait init method must be named as `initialize{TraitName}`
    public function initializeControllerTrait(Request $request): void
    {
        // $request will be auto-injected
    }
}

BaseRequest

\Squadron\Base\Http\Requests\BaseRequest This abstract class used for laravel's requests, authorizes all by default.

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2019-06-03

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固