定制 theanik/laravel-more-command 二次开发

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

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

theanik/laravel-more-command

Composer 安装命令:

composer require theanik/laravel-more-command

包简介

Create a Repository and Service class and trait using Artisan CLI

README 文档

README

issues forks stars GitHub license

Laravel More Command

Laravel More Command is a collection of a few php artisan commands. You can use it to create a Repository, Repository with Interface, Service, Trait, View(blade file), and Clear Log from the command line using php artisan command.

[Note : This package also worked for nWidart/laravel-modules]

Installation

Require the package with composer using the following command:

composer require theanik/laravel-more-command --dev

Or add the following to your composer.json's require-dev section and composer update

"require-dev": {
    "theanik/laravel-more-command": "^1.3.0"
}

Publish Package Configuration

 php artisan vendor:publish --provider="Theanik\LaravelMoreCommand\LaravelMoreCommandProvider" --tag="config"

To Change Default Namespace [config/laravel-more-command.php]

<?php
return [
    'repository-namespace' => 'App', // Your Desire Namespace for Repository Classes
    'service-namespace' => 'App', // Your Desire Namespace for Service Classes
];

Artisan Command List

  1. Make Repository
  2. Make Service
  3. Make Trait
  4. Make View
  5. Log Clear

Make Repository

Create a repository Class.
php artisan make:repository your-repository-name

Example:

php artisan make:repository UserRepository

or

php artisan make:repository Backend/UserRepository

The above will create a Repositories directory inside the App directory.\

Create a repository with Interface.
php artisan make:repository your-repository-name -i

Example:

php artisan make:repository UserRepository -i

or

php artisan make:repository Backend/UserRepository -i

Here you need to put extra -i flag. The above will create a Repositories directory inside the App directory.

In nWidart/laravel-modules Modules

Create a repository Class.
php artisan module:make-repository your-repository-name {module-name}

Example:

php artisan module:make-repository UserRepository Blog

or

php artisan module:make-repository Backend/UserRepository Blog

The above will create a Repositories directory inside the {Module} directory.

Create a repository with Interface.
php artisan module:make-repository your-repository-name {module-name} -i

Example:

php artisan module:make-repository UserRepository -i Blog

or

php artisan module:make-repository Backend/UserRepository -i Blog

Here you need to put extra -i flag. The above will create a Repositories directory inside the {Module} directory. \

An Example of created repository class:

<?php

namespace App\Repositories;

class UserRepository
{
    public function __constuct()
    {
        //
    }
}



Make Service

Create a Service Class.
php artisan make:service your-service-name

Example:

php artisan make:service UserService

or

php artisan make:service Backend/UserService

The above will create a Services directory inside the App directory.

In nWidart/laravel-modules Modules

php artisan module:make-service your-service-name {module-name}

Example:

php artisan module:make-service UserService

or

php artisan module:make-service Backend/UserService

The above will create a Services directory inside the {Module} directory.


Make Trait

Create a Trait.
php artisan make:trait your-trait-name

Example:

php artisan make:trait HasAuth

or

php artisan make:trait Backend/HasAuth

The above will create a Traits directory inside the App directory.

In nWidart/laravel-modules Modules

php artisan module:make-trait your-trait-name {module-name}

Example:

php artisan module:make-trait HasAuth

or

php artisan module:make-trait Backend/HasAuth

The above will create a Traits directory inside the {Module} directory.


Make View

Create a view.
php artisan make:view your-view-file-name

Example:

php artisan make:view index

or

php artisan make:view user/index

The above will create a blade file inside the /resource/views/ directory.

In nWidart/laravel-modules Modules

php artisan module:make-view your-view-file-name {module-name}

Example:

php artisan module:make-view index

or

php artisan module:make-view user/index

The above will create a blade file inside the {Module}/Resources/views/ directory.


Log Clear

php artisan log:clear

The above will deleted all old log data from /storage/logs/ directory.

License

The MIT License (MIT). Please see License for more information.

theanik/laravel-more-command 适用场景与选型建议

theanik/laravel-more-command 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 439.98k 次下载、GitHub Stars 达 96, 最近一次更新时间为 2021 年 01 月 28 日, 在 PHP 生态内属于活跃度较高的组件。

我们在过去多个企业项目中使用过 theanik/laravel-more-command 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。

围绕 theanik/laravel-more-command 我们能提供哪些服务?
定制开发 / 二次开发

基于 theanik/laravel-more-command 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。

BUG 修复 & 性能优化

线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。

项目外包 & 长期维护

承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。

yvsm@zunyunkeji.com QQ:316430983 微信:yvsm316 西安尊云信息科技 · 专注 PHP / Go / 分布式系统研发

统计信息

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

GitHub 信息

  • Stars: 96
  • Watchers: 3
  • Forks: 28
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2021-01-28