seeder_Email_activation
このコミットが含まれているのは:
コミット
67efdcc49d
11
backend/app/Models/EmailActivation.php
ノーマルファイル
11
backend/app/Models/EmailActivation.php
ノーマルファイル
@ -0,0 +1,11 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class EmailActivation extends Model
|
||||
{
|
||||
use HasFactory;
|
||||
}
|
11
backend/app/Models/child.php
ノーマルファイル
11
backend/app/Models/child.php
ノーマルファイル
@ -0,0 +1,11 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class child extends Model
|
||||
{
|
||||
use HasFactory;
|
||||
}
|
@ -22,7 +22,6 @@ class AdminFactory extends Factory
|
||||
public function definition()
|
||||
{
|
||||
return [
|
||||
// 'id' => $this->faker->numberBetween,
|
||||
'email' => $this->faker->email,
|
||||
'password' => $this->faker->password,
|
||||
'remember_token' => $this->faker->password,
|
||||
|
@ -0,0 +1,33 @@
|
||||
<?php
|
||||
|
||||
namespace Database\Factories;
|
||||
|
||||
use App\Models\EmailActivation;
|
||||
use Illuminate\Database\Eloquent\Factories\Factory;
|
||||
|
||||
class EmailActivationFactory extends Factory
|
||||
{
|
||||
/**
|
||||
* The name of the factory's corresponding model.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $model = EmailActivation::class;
|
||||
|
||||
/**
|
||||
* Define the model's default state.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function definition()
|
||||
{
|
||||
return [
|
||||
'father_id' => 1,
|
||||
'email' => $this->faker->email,
|
||||
'token' => $this->faker->randomNumber(8),
|
||||
'ttl' => $this->faker->dateTime,
|
||||
'created_at' => $this->faker->dateTime,
|
||||
'updated_at' => $this->faker->dateTime,
|
||||
];
|
||||
}
|
||||
}
|
@ -22,7 +22,6 @@ class FatherFactory extends Factory
|
||||
public function definition()
|
||||
{
|
||||
return [
|
||||
// 'id' => $this->faker->numberBetween,
|
||||
'email' => $this->faker->email,
|
||||
'email_verified_at' => $this->faker->dateTime,
|
||||
'password' => $this->faker->password,
|
||||
|
@ -0,0 +1,36 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
class CreateEmailActivationsTable extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::create('email_activations', function (Blueprint $table) {
|
||||
$table->bigIncrements('id');
|
||||
$table->integer('father_id');
|
||||
$table->string('email');
|
||||
$table->string('token');
|
||||
$table->timestamps('ttl');
|
||||
$table->timestamps('created_at');
|
||||
$table->timestamps('updated_at');
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::dropIfExists('email_activations');
|
||||
}
|
||||
}
|
@ -13,9 +13,11 @@ class DatabaseSeeder extends Seeder
|
||||
*/
|
||||
public function run()
|
||||
{
|
||||
// $this->call
|
||||
// (AdminsTableSeeder::class);
|
||||
// $this->call
|
||||
// (FathersTableSeeder::class);
|
||||
$this->call
|
||||
(AdminsTableSeeder::class);
|
||||
$this->call
|
||||
(FathersTableSeeder::class);
|
||||
(EmailActivationsTableSeeder::class);
|
||||
}
|
||||
}
|
||||
|
@ -0,0 +1,19 @@
|
||||
<?php
|
||||
|
||||
namespace Database\Seeders;
|
||||
use App\Models\EmailActivations;
|
||||
|
||||
use Illuminate\Database\Seeder;
|
||||
|
||||
class EmailActivationsTableSeeder extends Seeder
|
||||
{
|
||||
/**
|
||||
* Run the database seeds.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function run()
|
||||
{
|
||||
\App\Models\EmailActivation::factory()->count(10)->create();
|
||||
}
|
||||
}
|
新しいイシューから参照
ユーザーをブロックする