????

Your IP : 18.118.187.189


Current Path : /home/thenclexdoctor.com/public_html/app/Models/Traits/
Upload File :
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;
    }
}

Page not found | The NCLEX Doctor

Page not found!

Sorry, this page is not available...