Some checks failed
tests / ci (pull_request) Has been cancelled
- Implemented CourseRegistrationShow component for admin to view registration details. - Added course registration creation and listing for students. - Enhanced student registration edit and create forms with improved error handling. - Introduced new columns for course registration submissions in student view. - Updated routes for course registration management in admin and student contexts. - Added logging and status handling for course registration submissions. - Improved type definitions for course registration and user roles.
35 lines
786 B
PHP
35 lines
786 B
PHP
<?php
|
|
|
|
namespace App\Models;
|
|
|
|
use Illuminate\Database\Eloquent\Attributes\Guarded;
|
|
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
|
use Illuminate\Database\Eloquent\Model;
|
|
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
|
|
|
#[Guarded(['id'])]
|
|
class CourseRegistration extends Model
|
|
{
|
|
use HasFactory;
|
|
|
|
public function student(): BelongsTo
|
|
{
|
|
return $this->belongsTo(Student::class);
|
|
}
|
|
|
|
public function academicTerm(): BelongsTo
|
|
{
|
|
return $this->belongsTo(AcademicTerm::class);
|
|
}
|
|
|
|
public function courseClass(): BelongsTo
|
|
{
|
|
return $this->belongsTo(CourseClass::class);
|
|
}
|
|
|
|
public function submission(): BelongsTo
|
|
{
|
|
return $this->belongsTo(CourseRegistrationSubmission::class, 'submission_id');
|
|
}
|
|
}
|