PHPackages                             defabr13k/laravel-cogs - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [CLI &amp; Console](/categories/cli)
4. /
5. defabr13k/laravel-cogs

ActiveLaravel-5-package[CLI &amp; Console](/categories/cli)

defabr13k/laravel-cogs
======================

Cogs for Laravel is a Composer package that adds handy Artisan Console Commands for MySQL database administration.

v1.0.0(8y ago)073MITPHPPHP &gt;=7.1.0

Since Jun 14Pushed 8y ago1 watchersCompare

[ Source](https://github.com/defabr13k/laravel-cogs)[ Packagist](https://packagist.org/packages/defabr13k/laravel-cogs)[ RSS](/packages/defabr13k-laravel-cogs/feed)WikiDiscussions master Synced today

READMEChangelog (1)DependenciesVersions (2)Used By (0)

Cogs for Laravel
================

[](#cogs-for-laravel)

> **Cogs for Laravel** is a Composer package that adds handy Artisan Console Commands for MySQL database administration.

> **WARNING**
>
> Be aware that these Artisan Console Commands are meant for use on an disposable local development environments such as a Homestead environment. They may introduce potentially serious security risks when used in a production environment!

Features
--------

[](#features)

Artisan Console CommandFunctionality`cogs:db:backup`Dumps the database to SQL file for backup.`cogs:db:drop`Drops the database.`cogs:db:init`Creates a database user and the database, and executes migrations.`cogs:db:reset`Drops the database and runs `cogs:db:init`.`cogs:db:restore`Restores database from most recent SQL dump.`cogs:db:user`Creates a database user as specified in the configuration.Configuration
-------------

[](#configuration)

In `.env` there's already this:

```
DB_CONNECTION=mysql
DB_HOST=127.0.0.1
DB_PORT=3306
DB_DATABASE=homestead
DB_USERNAME=homestead
DB_PASSWORD=secret

```

You have to add `DB_ADMIN_USERNAME`, `DB_ADMIN_PASSWORD`, and `DB_DUMP_PATH` as well, e.g.:

```
DB_ADMIN_USERNAME=homestead
DB_ADMIN_PASSWORD=secret
DB_DUMP_PATH=database/dumps

```

Installation
------------

[](#installation)

### Install the latest release

[](#install-the-latest-release)

```
$ composer require --dev defabr13k/laravel-cogs

```

### Install the latest development version

[](#install-the-latest-development-version)

```
$ composer require --dev defabr13k/laravel-cogs=@dev

```

Prior to Laravel `5.5` you also need to add the following to `app/config/app.php`:

```
