nojacko/laravel-tools

Jacko's Laravel Tools.

This package's canonical repository appears to be gone and the package has been frozen as a result.

Installs: 281

Dependents: 0

Suggesters: 0

Security: 0

Stars: 0

Watchers: 1

Forks: 0

Type:project

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

This package is not auto-updated.

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


README

Bunch of things I use in Laravel.

Database

Optimizer

Runs OPTIMIZE TABLE on all tables in all you MySQL connections.

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

# Command
php artisan database:optimize

Wait

Repeatedly tries to query your database for --wait seconds before dying.

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

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

Base Console Class

An extension of Illuminate\Console\Command with useful functions and instantiates.

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();
}