Skip to content

Instantly share code, notes, and snippets.

View CraftLogan's full-sized avatar
🎯
Focusing

Logan H. Craft CraftLogan

🎯
Focusing
View GitHub Profile
@CraftLogan
CraftLogan / artisan_db_open.php
Created February 5, 2020 01:38 — forked from calebporzio/artisan_db_open.php
An artisan command for opening the project's database in TablePlus
<?php
Artisan::command('db:open {connection?}', function ($connection = null) {
if (! file_exists('/Applications/TablePlus.app')) {
$this->warn('This command uses TablePlus, are you sure it\'s installed?');
$this->line("Install here: https://tableplus.com/\n");
}
$driver = $connection ?: config('database.default');
$host = config("database.connections.{$driver}.host");