Laravel has a great mechanism of migrations, but what if you want to visualize your DB schema to see all in one place – to discuss with colleagues, for example. There is a great tool for that – here’s a brief overview of Laravel Schema Designer.
Created by Thomas Roelens back in 2013, it still remains an active project – in 2015 it was updated for Laravel 5 version.
In short, LaravelSD is a place where you can create your database schema just by playing with tables/columns/relationships, and then – most important – generate your migration files from the visual schema.
Basically, you register (takes 30 seconds), then go to the main page, enter your database name and start creating a schema.

You start from a clear canvas and can add elements by clicking buttons on the top.

When you click Add Table, you get a popup to fill table name and other parameters.

You fill them in and here’s the result – table appears on our canvas, with a lot of buttons to change, basically, anything you want: table, columns, order etc.
As you can see, there are Laravel increments and timestamps already prepared for you.

You can also drag-drop fields to change the order.
Let’s add another column title. Again, as you can see – a lot of options, related to Laravel functionality.

And another important feature – foreign keys and relationships between tables. Let’s create another table called clients and then link those two together.
First – we create an unsigned integer column with foreign key.

Then – create a relationship: there is a first button on the top.

And here we have also quite a lot of things to choose from. All related to good old Laravel. Really impressive.

And ta-daaa! The result:

So this way you create tables, columns and relationships one-by-one, and here comes the most important/impressive part: as soon as you’re ready, you can export the schema. And not only schema – there are a lot of things to export on the menu:

Let’s take a schema import as an example – you just get a ZIP archive, which has database/migrations folder with these files in it:

With a real Laravel code:
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
class CreateProjectsTable extends Migration {
public function up() {
Schema::create('projects', function(Blueprint $table) {
$table->increments('id');
$table->timestamps();
$table->string('title', 255);
$table->integer('client_id')->unsigned();
});
}
public function down() {
Schema::drop('projects');
}
}
So huge respect to the author again for such a tool – there are more functions to explore, so feel free to play with it and use for your projects.
A link once again: LaravelSD.com – Laravel Schema Designer
LaravelSD is a very useful tool. It not only helps me with creating migrations but also seeds, controllers, models (with relationships) and forms. I highly recommend it.
this is a testing data of whole city which is not genunie
seems like a great tool, make things simple at least for me (one thing less to deal with when building a new web app). I’m in the beginning of a new project, just about the phase when I need to decide the structure of the DB. for sure i’ll use it. Thanks
Extremely useful tool. Will be using it regularly
thanks for mention this website, I’m really happy to use this as replacement for MySQL Workbench. I’m not DB Admin, so mostly I used to use Visual tools
This tool is extremely useful. I think it would be great if this was bundled with Laravel.
Thas a really good tool, but how can you manage a large scale design? If my DB has 80 tables, what can I do?