about summary refs log tree commit diff
path: root/laravel/database
diff options
context:
space:
mode:
authorZach DeCook <zachdecook@gmail.com>2018-12-26 09:52:37 -0500
committerZach DeCook <zachdecook@gmail.com>2018-12-26 09:52:37 -0500
commit77f1076c15fbb8bf826a58cb2d556801a82a81ee (patch)
tree2d8dd905708c9bafe397aed4dbb7d03a644b48cb /laravel/database
parentd034708620b528d08bc8c4750439f84de484bc4a (diff)
downloadprosongsa-77f1076c15fbb8bf826a58cb2d556801a82a81ee.tar.gz
- Add laravel site directories
Diffstat (limited to 'laravel/database')
-rw-r--r--laravel/database/.gitignore1
-rw-r--r--laravel/database/factories/UserFactory.php24
-rw-r--r--laravel/database/migrations/2014_10_12_000000_create_users_table.php36
-rw-r--r--laravel/database/migrations/2014_10_12_100000_create_password_resets_table.php32
-rw-r--r--laravel/database/seeds/DatabaseSeeder.php16
5 files changed, 109 insertions, 0 deletions
diff --git a/laravel/database/.gitignore b/laravel/database/.gitignore
new file mode 100644
index 0000000..9b1dffd
--- /dev/null
+++ b/laravel/database/.gitignore
@@ -0,0 +1 @@
+*.sqlite
diff --git a/laravel/database/factories/UserFactory.php b/laravel/database/factories/UserFactory.php
new file mode 100644
index 0000000..ec15e58
--- /dev/null
+++ b/laravel/database/factories/UserFactory.php
@@ -0,0 +1,24 @@
+<?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,
+        'email_verified_at' => now(),
+        'password' => '$2y$10$TKh8H1.PfQx37YgCzwiKb.KjNyWgaHb9cbcoQgdIVFlYg7B77UdFm', // secret
+        'remember_token' => str_random(10),
+    ];
+});
diff --git a/laravel/database/migrations/2014_10_12_000000_create_users_table.php b/laravel/database/migrations/2014_10_12_000000_create_users_table.php
new file mode 100644
index 0000000..16a6108
--- /dev/null
+++ b/laravel/database/migrations/2014_10_12_000000_create_users_table.php
@@ -0,0 +1,36 @@
+<?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->timestamp('email_verified_at')->nullable();
+            $table->string('password');
+            $table->rememberToken();
+            $table->timestamps();
+        });
+    }
+
+    /**
+     * Reverse the migrations.
+     *
+     * @return void
+     */
+    public function down()
+    {
+        Schema::dropIfExists('users');
+    }
+}
diff --git a/laravel/database/migrations/2014_10_12_100000_create_password_resets_table.php b/laravel/database/migrations/2014_10_12_100000_create_password_resets_table.php
new file mode 100644
index 0000000..0d5cb84
--- /dev/null
+++ b/laravel/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/laravel/database/seeds/DatabaseSeeder.php b/laravel/database/seeds/DatabaseSeeder.php
new file mode 100644
index 0000000..91cb6d1
--- /dev/null
+++ b/laravel/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);
+    }
+}