added primary keys to all models

This commit is contained in:
2021-03-10 23:29:30 +09:00
parent 91bde37441
commit 4db6dac439
35 changed files with 197 additions and 19 deletions
+10
View File
@@ -14,4 +14,14 @@ class SrpFleetType extends Model
//Timestamps
public $timestamps = false;
/**
* The attributes that are mass assignable
*
* @var array
*/
protected $fillable = [
'code',
'description',
];
}
+1 -1
View File
@@ -22,6 +22,6 @@ class SrpPayout extends Model
];
public function shipType() {
return $this->belongsTo(SrpShipType::class);
return $this->belongsTo(SrpShipType::class, 'code', 'code');
}
}
+5 -1
View File
@@ -22,6 +22,10 @@ class SrpShipType extends Model
];
public function costCode() {
return $this->hasOne('App\Models\SRP\SrpPayout', 'code', 'code');
return $this->hasOne(App\Models\SRP\SrpPayout::class, 'code', 'code');
}
public function fleetType() {
return $this->belongsTo(App\Models\SRP\SrpFleetType::class, 'code', 'code');
}
}