Server : Apache System : Linux h2web276 4.9.0-0.bpo.12-amd64 #1 SMP Debian 4.9.210-1+deb9u1~deb8u1 (2020-06-09) x86_64 User : uid183121 ( 183121) PHP Version : 8.0.30 Disable Function : passthru,exec,system,popen,shell_exec,proc_open,pcntl_exec Directory : /home/clients/35966debc7d0d13be0a39d90b50635f3/sites/dd.noccanada.org/app/Models/ |
Upload File : |
<?php namespace App\Models; use Illuminate\Database\Eloquent\Model; class Incident extends Model { protected $guarded = []; protected $table = "incident"; public function escalateTo($userID) { Escalations::create([ 'fromUserID' => $this->assigned_to, 'toUserID' => $userID, 'byUserID' => \Auth::user()->id, 'incidentID' => $this->id, ]); $this->update([ 'assigned_to' => $userID, 'prev_assigned_to' => $this->assigned_to ]); $user = User::find($userID); $details = [ 'title' => 'Important Matter', 'body' => 'An incident has been escalated to you' ]; \Mail::to($user->email)->send(new \App\Mail\Escalate($details)); } }