Update workshop
This commit is contained in:
@@ -0,0 +1,36 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models\Program;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Illuminate\Database\Eloquent\SoftDeletes;
|
||||
use App\Models\Profile;
|
||||
use App\Models\Program\SesiWorkshop;
|
||||
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
||||
|
||||
class PesertaWorkshop extends Model
|
||||
{
|
||||
use HasFactory, SoftDeletes;
|
||||
|
||||
protected $table = 'peserta_workshop';
|
||||
|
||||
protected $fillable = [
|
||||
'sesi_workshop_id',
|
||||
'profil_id',
|
||||
'status',
|
||||
'created_by',
|
||||
'updated_by',
|
||||
'deleted_by',
|
||||
];
|
||||
|
||||
public function profil()
|
||||
{
|
||||
return $this->belongsTo(Profile::class, 'profil_id');
|
||||
}
|
||||
|
||||
public function sesiWorkshop()
|
||||
{
|
||||
return $this->belongsTo(SesiWorkshop::class, 'sesi_workshop_id');
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,40 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models\Program;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Illuminate\Database\Eloquent\SoftDeletes;
|
||||
use App\Models\Program\Workshop;
|
||||
use App\Models\Program\PesertaWorkshop;
|
||||
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
||||
use Illuminate\Database\Eloquent\Relations\HasMany;
|
||||
|
||||
class SesiWorkshop extends Model
|
||||
{
|
||||
use HasFactory, SoftDeletes;
|
||||
|
||||
protected $table = 'sesi_workshop';
|
||||
|
||||
protected $fillable = [
|
||||
'workshop_id',
|
||||
'judul',
|
||||
'deskripsi',
|
||||
'tanggal_awal',
|
||||
'tanggal_akhir',
|
||||
'status',
|
||||
'created_by',
|
||||
'updated_by',
|
||||
'deleted_by',
|
||||
];
|
||||
|
||||
public function workshop()
|
||||
{
|
||||
return $this->belongsTo(Workshop::class, 'workshop_id');
|
||||
}
|
||||
|
||||
public function pesertaWorkshop()
|
||||
{
|
||||
return $this->hasMany(PesertaWorkshop::class, 'sesi_workshop_id');
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,47 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models\Program;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Illuminate\Database\Eloquent\SoftDeletes;
|
||||
use App\Models\Program\Aktivitas;
|
||||
use App\Models\Program\SesiWorkshop;
|
||||
use App\Enums\StatusWorkshop;
|
||||
use App\Enums\JenisWorkshop;
|
||||
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
||||
use Illuminate\Database\Eloquent\Relations\HasMany;
|
||||
|
||||
class Workshop extends Model
|
||||
{
|
||||
use HasFactory, SoftDeletes;
|
||||
|
||||
protected $table = 'workshop';
|
||||
|
||||
protected $casts = [
|
||||
'status' => StatusWorkshop::class,
|
||||
'jenis' => JenisWorkshop::class,
|
||||
];
|
||||
|
||||
protected $fillable = [
|
||||
'program_aktivitas_id',
|
||||
'judul',
|
||||
'deskripsi',
|
||||
'jenis',
|
||||
'tanggal_awal',
|
||||
'tanggal_akhir',
|
||||
'status',
|
||||
'created_by',
|
||||
'updated_by',
|
||||
'deleted_by',
|
||||
];
|
||||
|
||||
public function program()
|
||||
{
|
||||
return $this->belongsTo(Aktivitas::class, 'program_aktivitas_id');
|
||||
}
|
||||
public function sesiWorkshop()
|
||||
{
|
||||
return $this->hasMany(SesiWorkshop::class, 'workshop_id');
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user