first commit

This commit is contained in:
2026-05-22 20:46:29 +08:00
commit b04f87f2b0
121 changed files with 14851 additions and 0 deletions

32
app/Models/Survey.php Normal file
View File

@@ -0,0 +1,32 @@
<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Model;
class Survey extends Model
{
protected $fillable = [
'title',
'date',
'user_id',
'uuid',
'perincian',
];
protected static function boot()
{
parent::boot();
static::creating(function ($model) {
if (empty($model->uuid)) {
$model->uuid = (string) \Illuminate\Support\Str::uuid();
}
});
}
public function user() { return $this->belongsTo(User::class); }
public function sections() { return $this->hasMany(Section::class); }
public function questions() { return $this->hasManyThrough(Question::class, Section::class); }
public function responses() { return $this->hasMany(Response::class); }
}