summaryrefslogtreecommitdiff
path: root/site/database
diff options
context:
space:
mode:
authorhorus_arch2018-02-07 18:07:53 +0100
committerhorus_arch2018-02-07 18:07:53 +0100
commit92eb8143762e116e8959f6270271fd5540ca50ac (patch)
treea9fdc5009b9816fb448431b24bac38f7a215d40d /site/database
parent71950479fbd6088f249e5fda3b180f294d1d745d (diff)
downloadalkobote-92eb8143762e116e8959f6270271fd5540ca50ac.tar.gz
Adds basic site in laravel.
Diffstat (limited to 'site/database')
-rw-r--r--site/database/.gitignore1
-rw-r--r--site/database/factories/UserFactory.php23
-rw-r--r--site/database/migrations/2014_10_12_000000_create_users_table.php35
-rw-r--r--site/database/migrations/2014_10_12_100000_create_password_resets_table.php32
-rw-r--r--site/database/seeds/DatabaseSeeder.php16
5 files changed, 107 insertions, 0 deletions
diff --git a/site/database/.gitignore b/site/database/.gitignore
new file mode 100644
index 0000000..9b1dffd
--- /dev/null
+++ b/site/database/.gitignore
@@ -0,0 +1 @@
+*.sqlite
diff --git a/site/database/factories/UserFactory.php b/site/database/factories/UserFactory.php
new file mode 100644
index 0000000..facf233
--- /dev/null
+++ b/site/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/site/database/migrations/2014_10_12_000000_create_users_table.php b/site/database/migrations/2014_10_12_000000_create_users_table.php
new file mode 100644
index 0000000..689cbee
--- /dev/null
+++ b/site/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/site/database/migrations/2014_10_12_100000_create_password_resets_table.php b/site/database/migrations/2014_10_12_100000_create_password_resets_table.php
new file mode 100644
index 0000000..0d5cb84
--- /dev/null
+++ b/site/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/site/database/seeds/DatabaseSeeder.php b/site/database/seeds/DatabaseSeeder.php
new file mode 100644
index 0000000..e119db6
--- /dev/null
+++ b/site/database/seeds/DatabaseSeeder.php
@@ -0,0 +1,16 @@
+<?php
+
+use Illuminate\Database\Seeder;
+
+class DatabaseSeeder extends Seeder
+{
+ /**
+ * Run the database seeds.
+ *
+ * @return void
+ */
+ public function run()
+ {
+ // $this->call(UsersTableSeeder::class);
+ }
+}