use Schema\Blueprint; use Illuminate\Support\Facades\Schema; Schema::create('users', function (Blueprint $table) { $table->increments('id'); $table->string('name'); $table->string('email')->unique(); $table->string('password'); $table->timestamps(); });
use Schema\Blueprint; use Illuminate\Support\Facades\Schema; Schema::table('users', function (Blueprint $table) { $table->boolean('active')->after('password'); });This code adds a new column called `active` to the `users` table after the `password` column. In summary, Schema is a PHP package library that makes working with database schemas easier and more intuitive. It provides a fluent API for defining tables, columns, indexes, and relationships, and supports all popular database vendors such as MySQL, PostgreSQL, SQLite, and SQL Server.