定制 ajaykushwaha25/custom-make-command 二次开发

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

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

ajaykushwaha25/custom-make-command

最新稳定版本:v3.1

Composer 安装命令:

composer require ajaykushwaha25/custom-make-command

包简介

A custom Artisan command for creating trait files.

README 文档

README

This package allows you to create custom make commands for your Laravel application, such as make:trait and more.

Installation

To install this package, require it using Composer. It is recommended to only require the package for development purposes.

composer require ajaykushwaha25/custom-make-command

Since Laravel uses Package Auto-Discovery, you don't need to manually add the ServiceProvider.

Laravel without auto-discovery:

If you don't use auto-discovery, add the ServiceProvider to the providers array in config/app.php

AjayKushwaha25\CustomMakeCommand\MakeCommandServiceProvider::class,

Commands available

The following commands are available after installing this package:

php artisan make:trait CustomTrait
php artisan custom:class CustomClass
php artisan custom:action ActionClass
php artisan custom:service ServiceClass

The make:trait command will create a trait file in the App\Traits folder.

The custom:class command will create a custom class file in the App folder. You can also specify a specific folder in which the class file should be generated. Note: The specified folder will be created inside the App folder.

UsesUUID Trait

The UsesUUID trait allows you to easily add UUID (Universally Unique Identifier) functionality to your Laravel model classes.

Usage

To use the UsesUUID trait in your model class, follow these steps:

  1. Import the trait at the top of your model class file:
use AjayKushwaha25\CustomMakeCommand\Traits\UsesUUID;
  1. Apply the trait to your model class:
class MyModel extends Model
{
    use UsesUUID;
    
    // ...
}

That's it! Your model class now has the UUID functionality provided by the UsesUUID trait.

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: Unknown
  • 更新时间: 2023-02-12