Sorry if this was asked, but I didn't seem to find the correct answer.
I need to create a table in the database from the controller.
I was naive to believe that below would work:
Schema::connection('mysql')->create('mytable_'.$id, function($table)
{
$table->increments('id');
$table->timestamps();
});
Where $idis the dynamic value passed to the controller function.
I posted below on top:
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
No luck - how to create a database table from the controller? Any ideas?
Error:

Solution
As Ben Swinburne said in the first comment, use Schemano!
source
share