Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Create migration file while creating table in Laravel Voyager

I am using Voyager framework for Laravel. Wherenever I create table from Database Manager its creating table but its not creating any migration file. And its not good user interface who works on git repository(share the application's database schema). Everyone in the group has to create table in backend and have to work. This is not good.

but It creates table in database(phpmyadmin) and we have option to create Model(while creating table)

Any solution? need quick response

like image 241
Lohith Avatar asked May 16 '18 07:05

Lohith


People also ask

How do I add a column to a table in Laravel migration?

The Laravel migrations will use the Schema facade to create and modify database tables and columns: Schema::create('tasks', function (Blueprint $table) { $table->bigIncrements('id'); $table->timestamps(); }); Inside the facade, you could specify the different columns that you want to add.

What is migration table in Laravel?

What is Laravel Migration? Laravel Migration is an essential feature in Laravel that allows you to create a table in your database. It allows you to modify and share the application's database schema. You can modify the table by adding a new column or deleting an existing column.


1 Answers

Unfortunately, Laravel Voyager doesn't make migrations for user tables.

There are two workarounds.

  1. Laravel Migrations Generator

Use this dev package to generate the migrations for the given tables. Availabe on GitHub at: https://github.com/Xethron/migrations-generator. View the documentation to see how to generate the migrations for the specific tables.

However, the collaborators will have to create the BREADs for them.

  1. Copying the database

While sharing the database, the laravel voyager config tables that have all the changes and specs will be available on all the collaborator accounts.

Laravel voyager saves all its configurations in tables. Hence removing the need to generate migrations. Porting the whole DB works for most of my projects since I work on most apps alone.

like image 181
Miller Adulu Avatar answered Oct 06 '22 17:10

Miller Adulu