Refactor: responses as ActivitesAttended
This commit is contained in:
37
app/Models/ActivitiesAttended.php
Normal file
37
app/Models/ActivitiesAttended.php
Normal file
@@ -0,0 +1,37 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class ActivitiesAttended extends Model
|
||||
{
|
||||
use HasFactory;
|
||||
|
||||
protected $fillable = [
|
||||
'title',
|
||||
'organising_institute',
|
||||
'address',
|
||||
'department_id',
|
||||
'faculty_id',
|
||||
'start_date',
|
||||
'end_date',
|
||||
'num_days',
|
||||
'activity_type',
|
||||
'category',
|
||||
'level',
|
||||
'proof',
|
||||
];
|
||||
|
||||
|
||||
// Define the relationship to the User (Faculty)
|
||||
public function department()
|
||||
{
|
||||
return $this->belongsTo(Department::class, 'department_id');
|
||||
}
|
||||
public function user()
|
||||
{
|
||||
return $this->belongsTo(User::class, 'faculty_id');
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user