????
Current Path : /home/thenclexdoctor.com/public_html/app/Models/Traits/ |
Current File : /home/thenclexdoctor.com/public_html/app/Models/Traits/CascadeDeletes.php |
<?php namespace App\Models\Traits; use Illuminate\Support\Facades\DB; trait CascadeDeletes { public function delete() { DB::beginTransaction(); if ($this->morphsFunctions) { foreach ($this->morphsFunctions as $morph) { $this->{$morph}()->delete(); } } $result = parent::delete(); if (!$result) throw new \RuntimeException('Model deletion failed'); DB::commit(); return $result; } }
Sorry, this page is not available...