nojacko/laravel-tools

Jacko的Laravel工具。

这个包的规范仓库似乎已经消失,因此该包已被冻结。

安装: 281

依赖者: 0

建议者: 0

安全性: 0

星标: 0

关注者: 1

分支: 0

类型:项目

dev-master 2016-11-12 16:18 UTC

This package is not auto-updated.

Last update: 2021-01-22 23:05:15 UTC


README

我在Laravel中使用的一些东西。

数据库

优化器

在所有MySQL连接中的所有表上运行 OPTIMIZE TABLE

# Kernel.php
protected $commands = [
    \JackosLaravelTools\Console\Commands\DatabaseOptimize::class,
];

# Command
php artisan database:optimize

等待

在退出前反复尝试查询您的数据库,持续时间为 --wait 秒。

# Kernel.php
protected $commands = [
    \JackosLaravelTools\Console\Commands\DatabaseWait::class,
];

# Command
php artisan database:wait {--wait=10}

基础控制台类

Illuminate\Console\Command 的扩展,包含有用的函数和实例。

use JackosLaravelTools\Console\Commands\Base;

namespace JackosLaravelTools\Console\Commands;

class DatabaseWait extends Base
{
    // Instance of `\League\CLImate\CLImate`
    protected $cli;

    // Prints "$this->name: $this->description".
    public function printIntro();

    // Prints "$this->name: $message".
    public function printLog($message = '');

    // Prints "$this->name: DONE".
    public function printOuttro();
}