Laravel - Creating tables dynamically (without migration)

Ugh, never mind... I worked on it for long enough, and the solution as always was... Very simple.

I just had to figure a connection for the database first, so instead of

Schema::create('tableName', function($table)
{           
    $table->increments('id');
});

It is

Schema::connection('mysql')->create('tableName', function($table)
{
    $table->increments('id');
});

Hope this helps someone someday in the future!


This one is even better.

use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

Schema::create('tableName', function (Blueprint $table) {
        $table->increments('id');
        $table->timestamps();
    });