承接 larapack/command-verification 相关项目开发

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

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

larapack/command-verification

Composer 安装命令:

composer require larapack/command-verification

包简介

Makes Artisan Commands prompt the console if it should continue.

README 文档

README

Makes Artisan Commands prompt the console if it should continue.

Installing

Install using composer composer require larapack/command-verification 1.*.

Usage

First add the trait Verifiable to your Artisan Command.

<?php

namespace App\Console\Commands;

use Illuminate\Console\Command;
use Larapack/CommandVerification/Verifiable;

class ExampleCommand extends Command
{
  use Verifiable;
  
  // ...
}

In order to make the user verify that he wants to run this command you will have to set your fire-method to run the verify-method and set the verify-attribute.

  protected $verify = 'This command will destroy your entire site!';

  public function fire()
  {
	  return $this->verify();
  }

If the user accept it will call the verified-method, so ensure you define that.

  public function verified()
  {
    $this->info('We have destroyed your entire site. Thanks for using our command.');
  }

It will look like this:

Command Line Example

Customizing

When calling the verify-method you can add the following parameters: $this->verify($message, Closure $callback)

  public function fire()
  {
	  return $this->verify('A custom verify message', function() {
	    $this->info('We have destroyed your entire site. Thanks for using our command.');
	  });
  }

This way you can overwrite the default verify message and the callback.

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2015-11-30

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固