
How to add is_activated column in database using laravel migration
Created at 06-Dec-2024 ,
By samar
public function up(): void
{
Schema::table('users', function (Blueprint $table) {
$table->boolean('is_activated')->default(false)->comment('false for not active users and true for active users');
});
}
/**
* Reverse the migrations.
*/
public function down(): void
{
Schema::table('users', function (Blueprint $table) {
$table->dropColumn('is_activated');
});
}
If you like what you are reading, please consider buying us a coffee ( or 2 ) as a token of appreciation.
Don't forget to share this article! Help us spread the word by clicking the share button below.
We appreciate your support and are committed to providing you valuable and informative content.
We are thankful for your never ending support.
Random Code Snippet Queries: Laravel
- Route not defined in Laravel
- How to get session in blade Laravel ?
- Get count of filter data, while return a small set of records
- How to add unique records in pivot columns of Laravel pivot table
- Class App\Http\Controllers\Admin\UserController Does Not Exist
- Session Doesn't Work on Redirect
- Multiple Level eager loading in Laravel
- How to pass external link in laravel blade to anchor tag
- In order to use the Auth::routes() method, please install the laravel/ui package
- How to create pivot table in laravel using migration
- Json encode method in laravel
- Rename Pivot Table in Laravel
- Fatal error: Uncaught Error: Class "Illuminate\Foundation\Application" not found
- Pagination in laravel
- How to print form data in laravel
- How to check query string exists or not in laravel blade
- Get only 10 records from table in laravel
- Ajax GET request in laravel
- On delete set foreign id column value null using migration in laravel 8
- Laravel clone model
- How to delete record in Laravel with ajax
- Get current URL on visit URL in Laravel
- How to create new user without form submission in laravel
- How to remove package from laravel
- How to get data from two tables in laravel