Created
May 7, 2020 15:20
-
-
Save jongravois/b63c583f32fda92307fe222336985fea to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace App\Http\Livewire\Quality\Portal; | |
use App\Models\FormQualityObservation; | |
use App\Models\QualityCategory; | |
use App\Models\QualityProcess; | |
use Livewire\Component; | |
class FormWorksheet extends Component | |
{ | |
public $observationID; | |
public $observation; | |
public $processes; | |
public $processId; | |
public $owner; | |
public $catId; | |
public $cats; | |
public $displayReasons = []; | |
public $reasons = []; | |
public function mount($id) | |
{ | |
$this->observationID = $id; | |
$this->observation = FormQualityObservation::with('owner', 'quality') | |
->with('uploads') | |
->find($id); | |
$this->processes = QualityProcess::with('deficits', 'owner') | |
->orderBy('title') | |
->get(); | |
} // end function | |
public function render() | |
{ | |
return view('livewire.quality.portal.form-worksheet'); | |
} // end function | |
public function updatedProcessId() | |
{ | |
$proc = QualityProcess::with('deficits', 'owner')->find($this->processId); | |
$this->owner = $proc->owner->name; | |
$this->cats = $proc->deficits; | |
} // end function | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment