Skip to content

Instantly share code, notes, and snippets.

@coccoinomane
Created December 27, 2018 20:45
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save coccoinomane/a1b01050806127a75bfdfd62906e07a7 to your computer and use it in GitHub Desktop.
Save coccoinomane/a1b01050806127a75bfdfd62906e07a7 to your computer and use it in GitHub Desktop.
Laravel migration that adds the columns required by Google Login as per this tutorial => https://medium.com/employbl/add-login-with-google-to-your-laravel-app-d2205f01b895
<?php
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class UpdateUsersTableForGoogleLogin extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::table('users', function (Blueprint $table) {
$table->string('google_id');
$table->string('avatar')->nullable();
$table->string('avatar_original')->nullable();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::table('users', function (Blueprint $table) {
$table->dropColumn('google_id');
$table->dropColumn('avatar');
$table->dropColumn('avatar_original');
});
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment