How to Update Table structure using migration – Laravel

Laravel is a PHP frame­work that provides develope­rs with an extensive range­ of tools for creating web applications. One of the­ essential feature­s that make Laravel stand out from others is its ability to manage­ database schemas effortle­ssly via migrations.

This feature helps simplify table­ structure modification without having to manually write intricate SQL que­ries by enabling deve­lopers to update them e­asily.

In this article, I show you 2 ways to update table structure using migration in Laravel 9.

How to Update Table structure using migration - Laravel

Read more

How to add Foreign key in Migration – Laravel

In Laravel, migrations are a way to modify and manage the database schema of the application. A foreign key is a field that is used to establish the relationship between two tables via the primary key (You can also use a non-primary field but not recommended).

In this tutorial, I show how you can add a foreign key constraint while creating a table using migration in the Laravel 10 project.

How to add Foreign key in migration - Laravel

Read more