このコミットが含まれているのは:
守矢諏訪子 2021-09-29 12:43:36 +09:00
コミット 42bab6995c
31個のファイルの変更389行の追加65行の削除

11
backend/app/Models/Contacts.php ノーマルファイル
ファイルの表示

@ -0,0 +1,11 @@
<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
class Contacts extends Model
{
use HasFactory;
}

11
backend/app/Models/LoginLimits.php ノーマルファイル
ファイルの表示

@ -0,0 +1,11 @@
<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
class LoginLimits extends Model
{
use HasFactory;
}

11
backend/app/Models/MeetingApprovals.php ノーマルファイル
ファイルの表示

@ -0,0 +1,11 @@
<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
class MeetingApprovals extends Model
{
use HasFactory;
}

11
backend/app/Models/Smss.php ノーマルファイル
ファイルの表示

@ -0,0 +1,11 @@
<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
class Smss extends Model
{
use HasFactory;
}

ファイルの表示

@ -24,7 +24,6 @@ class AdminFactory extends Factory
return [
'email' => $this->faker->email,
'password' => $this->faker->password,
'remember_token' => $this->faker->password,
'created_at' => $this->faker->dateTime,
'updated_at' => $this->faker->dateTime,
];

ファイルの表示

@ -21,15 +21,21 @@ class ChildFactory extends Factory
*/
public function definition()
{
$tel = [
'070'.rand(10000000, 99999999),
'080'.rand(10000000, 99999999),
'090'.rand(10000000, 99999999)
];
return [
'email' => $this->faker->email,
'tel' => $this->faker->phoneNumber,
'tel' => $tel[rand(0, 2)],
'tel_verified_at' => $this->faker->dateTime,
'password' => $this->faker->password,
'last_name' => $this->faker->lastName,
'first_name' => $this->faker->firstName,
'img' => $this->faker->imageUrl,
'image' => $this->faker->imageUrl,
'company' => $this->faker->company,
'remember_token' => $this->faker->macPlatformToken,
'created_at' => $this->faker->dateTime,
'updated_at' => $this->faker->dateTime,
];

ファイルの表示

@ -2,17 +2,17 @@
namespace Database\Factories;
use App\Models\MeetingChild;
use App\Models\Contacts;
use Illuminate\Database\Eloquent\Factories\Factory;
class MeetingChildFactory extends Factory
class ContactsFactory extends Factory
{
/**
* The name of the factory's corresponding model.
*
* @var string
*/
protected $model = MeetingChild::class;
protected $model = Contacts::class;
/**
* Define the model's default state.
@ -22,11 +22,10 @@ class MeetingChildFactory extends Factory
public function definition()
{
return [
'child_id'=>1,
'meeting_id'=>1,
'approval_at'=>$this->faker->dateTime,
'created_at'=>$this->faker->dateTime,
'updated_at'=>$this->faker->dateTime,
'email' => $this->faker->email,
'message' => $this->faker->realText(49),
'created_at' => $this->faker->dateTime,
'updated_at' => $this->faker->dateTime,
];
}
}

ファイルの表示

@ -22,6 +22,7 @@ class EmailActivationFactory extends Factory
public function definition()
{
return [
'type' => $this->faker->numberBetween($min=0, $max=1),
'father_id' => 1,
'email' => $this->faker->email,
'token' => $this->faker->creditCardNumber,

ファイルの表示

@ -21,15 +21,20 @@ class FatherFactory extends Factory
*/
public function definition()
{
$tel = [
'070'.rand(10000000, 99999999),
'080'.rand(10000000, 99999999),
'090'.rand(10000000, 99999999)
];
return [
'email' => $this->faker->email,
'email_verified_at' => $this->faker->dateTime,
'password' => $this->faker->password,
'last_name' => $this->faker->lastName,
'first_name' => $this->faker->firstName,
'company' => $this->faker->company,
'image' => $this->faker->imageUrl,
'profile' => $this->faker->realText(49),
'remember_token' => $this->faker->dateTime,
'tel' => $tel[rand(0, 2)],
'created_at' => $this->faker->dateTime,
'updated_at' => $this->faker->dateTime,
];

ファイルの表示

@ -22,10 +22,10 @@ class FatherRelationFactory extends Factory
public function definition()
{
return [
'father_id'=>1,
'child_id'=>1,
'created_at'=>$this->faker->dateTime,
'updated_at'=>$this->faker->dateTime,
'father_id' => 1,
'child_id' => 1,
'created_at' => $this->faker->dateTime,
'updated_at' => $this->faker->dateTime,
];
}
}

ファイルの表示

@ -0,0 +1,38 @@
<?php
namespace Database\Factories;
use App\Models\LoginLimits;
use Illuminate\Database\Eloquent\Factories\Factory;
class LoginLimitsFactory extends Factory
{
/**
* The name of the factory's corresponding model.
*
* @var string
*/
protected $model = LoginLimits::class;
/**
* Define the model's default state.
*
* @return array
*/
public function definition()
{
$ua = [
'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) QtWebEngine/5.15.2 Chrome/87.0.4280.144 Safari/537.36', // qutebrowser
'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/93.0.4577.82 Safari/537.36', // brave
'Mozilla/5.0 (Windows NT 10.0; rv:91.0) Gecko/20100101 Firefox/91.0', // firefox
'Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Goanna/4.8 Firefox/68.0 PaleMoon/29.4.1' // palemoon
];
return [
'user_agent' => $ua[rand(0, 3)],
'fail_number' => rand(0, 10),
'created_at' => $this->faker->dateTime,
'updated_at' => $this->faker->dateTime,
];
}
}

ファイルの表示

@ -0,0 +1,32 @@
<?php
namespace Database\Factories;
use App\Models\MeetingApprovals;
use Illuminate\Database\Eloquent\Factories\Factory;
class MeetingApprovalsFactory extends Factory
{
/**
* The name of the factory's corresponding model.
*
* @var string
*/
protected $model = MeetingApprovals::class;
/**
* Define the model's default state.
*
* @return array
*/
public function definition()
{
return [
'child_id' => 1,
'meeting_id' => 1,
'approval_at' => $this->faker->dateTime,
'created_at' => $this->faker->dateTime,
'updated_at' => $this->faker->dateTime,
];
}
}

ファイルの表示

@ -22,11 +22,12 @@ class MeetingFactory extends Factory
public function definition()
{
return [
'father_id'=>1,
'title'=>$this->faker->name,
'text'=>$this->faker->realText(49),
'pdf'=>$this->faker->url,
'is_favorite'=>$this->faker->numberBetween($min=0, $max=1),
'father_id' => 1,
'title' => $this->faker->name,
'text' => $this->faker->realText(49),
'pdf' => $this->faker->url,
'memo' => $this->faker->realText(49),
'is_favorite' => $this->faker->numberBetween($min=0, $max=1),
'created_at' => $this->faker->dateTime,
'updated_at' => $this->faker->dateTime,
];

ファイルの表示

@ -22,8 +22,8 @@ class MeetingImageFactory extends Factory
public function definition()
{
return [
'meeting_id'=>1,
'image'=>$this->faker->url,
'meeting_id' => 1,
'image' => $this->faker->url,
'created_at' => $this->faker->dateTime,
'updated_at' => $this->faker->dateTime,
];

32
backend/database/factories/SmssFactory.php ノーマルファイル
ファイルの表示

@ -0,0 +1,32 @@
<?php
namespace Database\Factories;
use App\Models\Smss;
use Illuminate\Database\Eloquent\Factories\Factory;
class SmssFactory extends Factory
{
/**
* The name of the factory's corresponding model.
*
* @var string
*/
protected $model = Smss::class;
/**
* Define the model's default state.
*
* @return array
*/
public function definition()
{
return [
'send_id' => 1,
'receive_id' => 1,
'is_sent' => rand(0, 2),
'created_at' => $this->faker->dateTime,
'updated_at' => $this->faker->dateTime,
];
}
}

ファイルの表示

@ -21,9 +21,16 @@ class TelActivationFactory extends Factory
*/
public function definition()
{
$tel = [
'070'.rand(10000000, 99999999),
'080'.rand(10000000, 99999999),
'090'.rand(10000000, 99999999)
];
return [
'child_id'=>1,
'tel'=>$this->faker->phoneNumber,
'type' => rand(0, 1),
'child_id' => 1,
'tel' => $tel[rand(0, 2)],
'token' => $this->faker->creditCardNumber,
'ttl' => $this->faker->dateTime,
'created_at' => $this->faker->dateTime,

ファイルの表示

@ -15,9 +15,8 @@ class CreateAdminsTable extends Migration
{
Schema::create('admins', function (Blueprint $table) {
$table->id();
$table->string('email')->unique();
$table->string('password');
$table->rememberToken();
$table->string('email', 72)->unique();
$table->string('password', 72);
$table->timestamps();
});
}

ファイルの表示

@ -15,14 +15,13 @@ class CreateFathersTable extends Migration
{
Schema::create('fathers', function (Blueprint $table) {
$table->id();
$table->string('email');
$table->dateTime('email_verified_at')->nullable();
$table->string('password')->nullable();
$table->string('last_name')->nullable();
$table->string('first_name')->nullable();
$table->string('image')->nullable();
$table->string('profile')->nullable();
$table->rememberToken();
$table->string('email', 255)->unique();
$table->dateTime('email_verified_at');
$table->string('password', 72);
$table->string('company', 100)->nullable();
$table->string('image', 100)->nullable();
$table->string('profile', 1000)->nullable();
$table->string('tel', 11)->unique();
$table->timestamps();
});
}

ファイルの表示

@ -15,10 +15,10 @@ class CreateEmailActivationsTable extends Migration
{
Schema::create('email_activations', function (Blueprint $table) {
$table->id();
$table->unsignedBigInteger('father_id');
$table->foreign('father_id')->references('id')->on('fathers');
$table->string('email');
$table->string('token');
$table->unsignedTinyInteger('type');
$table->unsignedBigInteger('father_id')->nullable();
$table->string('email', 255)->unique();
$table->string('token', 16);
$table->dateTime('ttl');
$table->timestamps();
});

ファイルの表示

@ -15,14 +15,14 @@ class CreateChildrenTable extends Migration
{
Schema::create('children', function (Blueprint $table) {
$table->id();
$table->string('email')->nullable();
$table->string('tel');
$table->dateTime('tel_verified_at')->nullable();
$table->string('last_name')->nullable();
$table->string('first_name')->nullable();
$table->string('img')->nullable();
$table->string('company')->nullable();
$table->rememberToken();
$table->string('email', 72)->unique();
$table->string('tel', 11)->unique();
$table->dateTime('tel_verified_at');
$table->string('password', 255);
$table->string('last_name', 100);
$table->string('first_name', 100);
$table->string('image', 100)->nullable();
$table->string('company', 255)->nullable();
$table->timestamps();
});
}

ファイルの表示

@ -15,10 +15,11 @@ class CreateTelActivationsTable extends Migration
{
Schema::create('tel_activations', function (Blueprint $table) {
$table->id();
$table->unsignedBigInteger('child_id');
$table->unsignedTinyInteger('type');
$table->unsignedBigInteger('child_id')->nullable();
$table->foreign('child_id')->references('id')->on('children');
$table->string('tel');
$table->string('token');
$table->string('tel', 11)->unique();
$table->string('token', 100);
$table->dateTime('ttl');
$table->timestamps();
});

ファイルの表示

@ -17,10 +17,11 @@ class CreateMeetingsTable extends Migration
$table->id();
$table->unsignedBigInteger('father_id');
$table->foreign('father_id')->references('id')->on('fathers');
$table->string('title');
$table->string('text');
$table->string('pdf')->nullable();
$table->integer('is_favorite')->default(0);
$table->string('title', 255);
$table->string('text', 2000);
$table->string('pdf', 255)->nullable();
$table->string('memo', 2000)->nullable();
$table->integer('is_favorite')->nullable()->default(0);
$table->timestamps();
});
}

ファイルの表示

@ -0,0 +1,33 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class CreateLoginLimitsTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('login_limits', function (Blueprint $table) {
$table->id();
$table->string('user_agent', 300);
$table->unsignedInteger('fail_number');
$table->timestamps();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('login_limits');
}
}

ファイルの表示

@ -4,7 +4,7 @@ use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class CreateMeetingChildrenTable extends Migration
class CreateMeetingApprovalsTable extends Migration
{
/**
* Run the migrations.
@ -13,7 +13,7 @@ class CreateMeetingChildrenTable extends Migration
*/
public function up()
{
Schema::create('meeting_children', function (Blueprint $table) {
Schema::create('meeting_approvals', function (Blueprint $table) {
$table->id();
$table->unsignedBigInteger('child_id');
$table->foreign('child_id')->references('id')->on('children');
@ -31,6 +31,6 @@ class CreateMeetingChildrenTable extends Migration
*/
public function down()
{
Schema::dropIfExists('meeting_children');
Schema::dropIfExists('meeting_approvals');
}
}

ファイルの表示

@ -0,0 +1,35 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class CreateSmssesTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('smsses', function (Blueprint $table) {
$table->id();
$table->unsignedTinyInteger('send_id');
$table->unsignedBigInteger('receive_id');
$table->foreign('receive_id')->references('id')->on('children');
$table->unsignedTinyInteger('is_sent')->default(0);
$table->timestamps();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('smsses');
}
}

ファイルの表示

@ -0,0 +1,33 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class CreateContactsTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('contacts', function (Blueprint $table) {
$table->id();
$table->string('email', 255);
$table->string('message', 1000);
$table->timestamps();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('contacts');
}
}

ファイルの表示

@ -3,9 +3,8 @@
namespace Database\Seeders;
use Illuminate\Database\Seeder;
use App\Models\MeetingChild;
class MeetingChildrenTableSeeder extends Seeder
class ContactsSeeder extends Seeder
{
/**
* Run the database seeds.
@ -14,6 +13,6 @@ class MeetingChildrenTableSeeder extends Seeder
*/
public function run()
{
\App\Models\MeetingChild::factory()->count(10)->create();
\App\Models\Contacts::factory()->count(10)->create();
}
}

ファイルの表示

@ -30,6 +30,12 @@ class DatabaseSeeder extends Seeder
$this->call
(MeetingImagesTableSeeder::class);
$this->call
(MeetingChildrenTableSeeder::class);
(MeetingApprovalsSeeder::class);
$this->call
(LoginLimitsSeeder::class);
$this->call
(ContactsSeeder::class);
$this->call
(SmssSeeder::class);
}
}

ファイルの表示

@ -0,0 +1,18 @@
<?php
namespace Database\Seeders;
use Illuminate\Database\Seeder;
class LoginLimitsSeeder extends Seeder
{
/**
* Run the database seeds.
*
* @return void
*/
public function run()
{
\App\Models\LoginLimits::factory()->count(10)->create();
}
}

ファイルの表示

@ -0,0 +1,18 @@
<?php
namespace Database\Seeders;
use Illuminate\Database\Seeder;
class MeetingApprovalsSeeder extends Seeder
{
/**
* Run the database seeds.
*
* @return void
*/
public function run()
{
\App\Models\MeetingApprovals::factory()->count(10)->create();
}
}

18
backend/database/seeders/SmssSeeder.php ノーマルファイル
ファイルの表示

@ -0,0 +1,18 @@
<?php
namespace Database\Seeders;
use Illuminate\Database\Seeder;
class SmssSeeder extends Seeder
{
/**
* Run the database seeds.
*
* @return void
*/
public function run()
{
\App\Models\Smss::factory()->count(10)->create();
}
}