'array', 'completed_at' => 'datetime', ]; public function project() { return $this->belongsTo(Project::class); } public function layer() { return $this->belongsTo(Layer::class); } public function template() { return $this->belongsTo(InspectionTemplate::class); } public function user() { return $this->belongsTo(User::class); } public function inspector() { return $this->belongsTo(User::class, 'inspector_user_id'); } public function feature() { return $this->belongsTo(Feature::class, 'feature_id'); } public function issues() { return $this->hasMany(Issue::class); } public function scopePending($q) { return $q->where('status', 'pending'); } public function scopeCompleted($q) { return $q->where('status', 'completed'); } public function scopeRejected($q) { return $q->where('status', 'rejected'); } }