37 lines
713 B
PHP
37 lines
713 B
PHP
<?php
|
|
|
|
namespace App\Models;
|
|
|
|
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
|
use Illuminate\Database\Eloquent\Model;
|
|
|
|
class CourseAssignStudent extends Model
|
|
{
|
|
use HasFactory;
|
|
|
|
// Database table name
|
|
protected $table = 'course_assign_student';
|
|
|
|
// Mass assignable attributes
|
|
protected $fillable = [
|
|
'student_details_id',
|
|
'course_id',
|
|
];
|
|
|
|
/**
|
|
* Relationship: Student Details
|
|
*/
|
|
public function studentDetail()
|
|
{
|
|
return $this->belongsTo(StudentDetail::class, 'student_details_id');
|
|
}
|
|
|
|
/**
|
|
* Relationship: Course
|
|
*/
|
|
public function course()
|
|
{
|
|
return $this->belongsTo(Course::class, 'course_id');
|
|
}
|
|
}
|