/ app / Models / CorrectiveAction.php
CorrectiveAction.php
 1  <?php
 2  
 3  namespace App\Models;
 4  
 5  use Illuminate\Database\Eloquent\Factories\HasFactory;
 6  use Illuminate\Database\Eloquent\Model;
 7  
 8  class CorrectiveAction extends Model
 9  {
10      use HasFactory;
11  
12      protected $fillable = [
13          'approved',
14          'implemented',
15          'verified',
16          'cause_analysis',
17          'correction',
18          'corrective_action',
19          'evidence',
20      ];
21  
22      protected $casts = [
23          'evidence' => 'array',
24      ];
25  
26  
27      public function nonConformity()
28      {
29          return $this->belongsTo(ValidationRequirementResponse::class, 'non_conformity_id');
30      }
31  
32      public function planDocument()
33      {
34          return $this->belongsTo(Document::class, 'ca_plan_document_id');
35      }
36  }