How to use DB Transaction with Repository Pattern in Laravel?

07-06-2017

In Laravel framework, we can use following transaction block with repository pattern and classic eloquent usage:

DB::transaction(function () use ($talep, $input,$id) {
            UrunTalep::where('talep_id', '=', $talep->id)->forceDelete();
            $talep = $this->talepRepository->update($input, $id);
        });
       

© 2019 All rights reserved. Codesenior.COM