From 2b7e31ffa79f508453bc5c759a7511e476cbbe96 Mon Sep 17 00:00:00 2001 From: Marvin Borner Date: Sun, 8 Jul 2018 17:14:26 +0200 Subject: Added basic blockchain-like hashing for verified data --- .../migrations/2014_10_12_000000_create_users_table.php | 1 + .../2018_07_07_104937_create_public_keys_table.php | 2 +- database/seeds/DatabaseSeeder.php | 16 +++++++++++++++- 3 files changed, 17 insertions(+), 2 deletions(-) (limited to 'database') diff --git a/database/migrations/2014_10_12_000000_create_users_table.php b/database/migrations/2014_10_12_000000_create_users_table.php index 6751167..55e1804 100644 --- a/database/migrations/2014_10_12_000000_create_users_table.php +++ b/database/migrations/2014_10_12_000000_create_users_table.php @@ -18,6 +18,7 @@ class CreateUsersTable extends Migration $table->string('email')->unique(); $table->string('password'); $table->string('avatar')->default('0.png'); + $table->string('hash', 60)->unique(); $table->rememberToken(); $table->timestamps(); }); diff --git a/database/migrations/2018_07_07_104937_create_public_keys_table.php b/database/migrations/2018_07_07_104937_create_public_keys_table.php index 5a1dda4..c9d548e 100644 --- a/database/migrations/2018_07_07_104937_create_public_keys_table.php +++ b/database/migrations/2018_07_07_104937_create_public_keys_table.php @@ -4,7 +4,7 @@ use Illuminate\Support\Facades\Schema; use Illuminate\Database\Schema\Blueprint; use Illuminate\Database\Migrations\Migration; -class CreatePublicKeyTable extends Migration +class CreatePublicKeysTable extends Migration { /** * Run the migrations. diff --git a/database/seeds/DatabaseSeeder.php b/database/seeds/DatabaseSeeder.php index 91cb6d1..db0f2fd 100644 --- a/database/seeds/DatabaseSeeder.php +++ b/database/seeds/DatabaseSeeder.php @@ -1,6 +1,7 @@ call(UsersTableSeeder::class); + DB::table('users')->insert([ + 'id' => 0, + 'name' => 'genesis', + 'email' => ' ', + 'password' => ' ', + 'hash' => bcrypt('genesis') + ]); + + DB::table('users')->insert([ + 'name' => 'Marvin Borner', + 'email' => 'marvin@borners.de', + 'password' => bcrypt('password'), + 'hash' => bcrypt(bcrypt('genesis') . 'Marvin Borner'. 'marvin@borners.de'. 'password') // hashing: prev hash, all fields in current 'block' + ]); } } -- cgit v1.2.3