aboutsummaryrefslogtreecommitdiffhomepage
path: root/database
diff options
context:
space:
mode:
Diffstat (limited to 'database')
-rw-r--r--database/.gitignore1
-rw-r--r--database/factories/UserFactory.php23
-rw-r--r--database/migrations/2014_10_12_000000_create_users_table.php35
-rw-r--r--database/migrations/2014_10_12_100000_create_password_resets_table.php32
-rw-r--r--database/seeds/DatabaseSeeder.php16
5 files changed, 107 insertions, 0 deletions
diff --git a/database/.gitignore b/database/.gitignore
new file mode 100644
index 0000000..9b1dffd
--- /dev/null
+++ b/database/.gitignore
@@ -0,0 +1 @@
+*.sqlite
diff --git a/database/factories/UserFactory.php b/database/factories/UserFactory.php
new file mode 100644
index 0000000..facf233
--- /dev/null
+++ b/database/factories/UserFactory.php
@@ -0,0 +1,23 @@
+<?php
+
+use Faker\Generator as Faker;
+
+/*
+|--------------------------------------------------------------------------
+| Model Factories
+|--------------------------------------------------------------------------
+|
+| This directory should contain each of the model factory definitions for
+| your application. Factories provide a convenient way to generate new
+| model instances for testing / seeding your application's database.
+|
+*/
+
+$factory->define(App\User::class, function (Faker $faker) {
+ return [
+ 'name' => $faker->name,
+ 'email' => $faker->unique()->safeEmail,
+ 'password' => '$2y$10$TKh8H1.PfQx37YgCzwiKb.KjNyWgaHb9cbcoQgdIVFlYg7B77UdFm', // secret
+ 'remember_token' => str_random(10),
+ ];
+});
diff --git a/database/migrations/2014_10_12_000000_create_users_table.php b/database/migrations/2014_10_12_000000_create_users_table.php
new file mode 100644
index 0000000..689cbee
--- /dev/null
+++ b/database/migrations/2014_10_12_000000_create_users_table.php
@@ -0,0 +1,35 @@
+<?php
+
+use Illuminate\Support\Facades\Schema;
+use Illuminate\Database\Schema\Blueprint;
+use Illuminate\Database\Migrations\Migration;
+
+class CreateUsersTable extends Migration
+{
+ /**
+ * Run the migrations.
+ *
+ * @return void
+ */
+ public function up()
+ {
+ Schema::create('users', function (Blueprint $table) {
+ $table->increments('id');
+ $table->string('name');
+ $table->string('email')->unique();
+ $table->string('password');
+ $table->rememberToken();
+ $table->timestamps();
+ });
+ }
+
+ /**
+ * Reverse the migrations.
+ *
+ * @return void
+ */
+ public function down()
+ {
+ Schema::dropIfExists('users');
+ }
+}
diff --git a/database/migrations/2014_10_12_100000_create_password_resets_table.php b/database/migrations/2014_10_12_100000_create_password_resets_table.php
new file mode 100644
index 0000000..0d5cb84
--- /dev/null
+++ b/database/migrations/2014_10_12_100000_create_password_resets_table.php
@@ -0,0 +1,32 @@
+<?php
+
+use Illuminate\Support\Facades\Schema;
+use Illuminate\Database\Schema\Blueprint;
+use Illuminate\Database\Migrations\Migration;
+
+class CreatePasswordResetsTable extends Migration
+{
+ /**
+ * Run the migrations.
+ *
+ * @return void
+ */
+ public function up()
+ {
+ Schema::create('password_resets', function (Blueprint $table) {
+ $table->string('email')->index();
+ $table->string('token');
+ $table->timestamp('created_at')->nullable();
+ });
+ }
+
+ /**
+ * Reverse the migrations.
+ *
+ * @return void
+ */
+ public function down()
+ {
+ Schema::dropIfExists('password_resets');
+ }
+}
diff --git a/database/seeds/DatabaseSeeder.php b/database/seeds/DatabaseSeeder.php
new file mode 100644
index 0000000..91cb6d1
--- /dev/null
+++ b/database/seeds/DatabaseSeeder.php
@@ -0,0 +1,16 @@
+<?php
+
+use Illuminate\Database\Seeder;
+
+class DatabaseSeeder extends Seeder
+{
+ /**
+ * Seed the application's database.
+ *
+ * @return void
+ */
+ public function run()
+ {
+ // $this->call(UsersTableSeeder::class);
+ }
+}