Laravel Migration

Laravel Migration Tutorial for Beginners

Laravel-Migration.jpg
Laravel Migration
Migrations are basically known to be the same as the version control for the user’s database that permits the user’s team to easily modify and share the application's database schema. These are usually paired with the Laravel's schema builder in order to build your application's database schema with extreme ease. In case the user ever had to tell a teammate about manually adding a column to their local database schema then any problem that has been faced will be solved by the database migrations.

Generating Migrations

There are basically various ways that can be used by the programmer to generate this thing and one of the ways is to create a migration by the use of the make: migration Artisan command that has been depicted below:

PHP artisan make:migration create_users_table

The new Laravel migration that has been generated will be placed generally in the user’s database directory. Every file name of this subject usually contains a timestamp that allows Laravel in order to determine the order of the migrations. Another method of this subject is to use the--table and --create options that may also be used in order to indicate the name of the table and to check whether the migration will be creating a new table or not. These options are known for their ability to pre-fill the generated migration stub file with the specified table.

Migration Structure

The class of this method generally contains two methods that are up and down. The up method is usually used in order to add new tables, columns, or indexes to the user’s database, on the other hand, the down method is generally used in order to reverse the operations that have been performed by the up method. Please note that within both of these methods the user may use the Laravel schema builder in order to expressively create and modify tables. To grasp the concept of this completely and to know more about this subject, it is recommended to go through an online Laravel Tutorial that will enhance your learning process and will prepare you for the best to come.

Read More.....

Also Visit More - MySQL Tutorial for Beginners

Comments

Popular posts from this blog

Laravel Tutorial for Beginners

Ajax Tutorial

CodeIgniter Tutorial