QuestionKpRelation.php 627 B

12345678910111213141516171819202122232425262728293031
  1. <?php
  2. namespace App\Models;
  3. use Illuminate\Database\Eloquent\Factories\HasFactory;
  4. use Illuminate\Database\Eloquent\Model;
  5. use Illuminate\Database\Eloquent\Relations\BelongsTo;
  6. class QuestionKpRelation extends Model
  7. {
  8. use HasFactory;
  9. protected $table = 'question_kp_relations';
  10. protected $fillable = [
  11. 'question_id',
  12. 'kp_code',
  13. 'weight',
  14. ];
  15. protected $casts = [
  16. 'weight' => 'float',
  17. 'created_at' => 'datetime',
  18. 'updated_at' => 'datetime',
  19. ];
  20. public function question(): BelongsTo
  21. {
  22. return $this->belongsTo(Question::class);
  23. }
  24. }