Complete the code to add a string column named 'title' to the table.
Schema::create('posts', function (Blueprint $table) { $table->[1]('title'); });
The string method adds a VARCHAR column, suitable for titles.
Complete the code to add an integer column named 'age' to the table.
Schema::table('users', function (Blueprint $table) { $table->[1]('age'); });
The integer method adds a column for whole numbers like age.
Fix the error in the code to add a boolean column named 'is_active'.
Schema::table('accounts', function (Blueprint $table) { $table->[1]('is_active'); });
The boolean method adds a true/false column, perfect for flags like 'is_active'.
Fill both blanks to add a decimal column named 'price' with 8 digits total and 2 decimal places.
Schema::table('products', function (Blueprint $table) { $table->[1]('price', [2], 2); });
The decimal method defines a decimal column. The first number is total digits, here 8.
Fill all three blanks to add a string column 'email' that is unique and nullable.
Schema::table('users', function (Blueprint $table) { $table->[1]('email')->[2]()->[3](); });
The string method creates the column, unique ensures no duplicates, and nullable allows empty values.