そうして、マイグレーションを修正するには、「child.php」→「Child.php」に変えました

このコミットが含まれているのは:
守矢諏訪子 2021-09-28 18:01:11 +09:00
コミット fd4c0144e5
7個のファイルの変更0行の追加136行の削除

ファイルの表示

@ -1,14 +0,0 @@
<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
class FatherRelations extends Model
{
public function father ()
{
return $this->belongsTo(Fathers::class);
}
}

ファイルの表示

@ -1,14 +0,0 @@
<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
class Fathers extends Model
{
public function relations ()
{
return $this->hasMany(FatherRelations::class);
}
}

ファイルの表示

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

ファイルの表示

@ -1,32 +0,0 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class CreateFatherRelationsTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('father_relations', function (Blueprint $table) {
$table->id();
$table->integer('father_id');
$table->timestamps();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('father_relations');
}
}

ファイルの表示

@ -1,21 +0,0 @@
<?php
namespace Database\Seeders;
use Illuminate\Database\Seeder;
use Illuminate\Support\Facades\DB;
class FatherRelationsSeeder extends Seeder
{
/**
* Run the database seeds.
*
* @return void
*/
public function run()
{
DB::table('father_relations')->insert([
'father_id' => 1,
]);
}
}

ファイルの表示

@ -1,22 +0,0 @@
<?php
namespace Database\Seeders;
use Illuminate\Database\Seeder;
use Illuminate\Support\Facades\DB;
class FathersSeeder extends Seeder
{
/**
* Run the database seeds.
*
* @return void
*/
public function run()
{
DB::table('fathers')->insert([
'company' => 1,
'image' => '',
]);
}
}