generated from liutk/owl-admin-base
Update
parent
04b20257bf
commit
0c90525765
|
|
@ -6,7 +6,9 @@ use App\Traits\CustomActionTrait;
|
|||
use Illuminate\Http\Request;
|
||||
use Illuminate\Support\Arr;
|
||||
use Illuminate\Support\Facades\DB;
|
||||
use Illuminate\Validation\ValidationException;
|
||||
use Slowlyo\OwlAdmin\Controllers\AdminController as Controller;
|
||||
use Slowlyo\OwlAdmin\Exceptions\AdminException;
|
||||
use Throwable;
|
||||
|
||||
/**
|
||||
|
|
@ -39,7 +41,7 @@ abstract class AdminController extends Controller
|
|||
DB::commit();
|
||||
} catch (Throwable $th) {
|
||||
DB::rollBack();
|
||||
throw $th;
|
||||
throw $this->prepareException($th);
|
||||
}
|
||||
|
||||
return $this->response()->successMessage(__('admin.save') . __('admin.successfully'));
|
||||
|
|
@ -68,7 +70,7 @@ abstract class AdminController extends Controller
|
|||
DB::commit();
|
||||
} catch (Throwable $th) {
|
||||
DB::rollBack();
|
||||
throw $th;
|
||||
throw $this->prepareException($th);
|
||||
}
|
||||
|
||||
return $this->response()->successMessage(__('admin.save') . __('admin.successfully'));
|
||||
|
|
@ -87,7 +89,7 @@ abstract class AdminController extends Controller
|
|||
DB::commit();
|
||||
} catch (Throwable $th) {
|
||||
DB::rollBack();
|
||||
throw $th;
|
||||
throw $this->prepareException($th);
|
||||
}
|
||||
|
||||
return $this->response()->successMessage(__('admin.delete') . __('admin.successfully'));
|
||||
|
|
@ -103,4 +105,9 @@ abstract class AdminController extends Controller
|
|||
|
||||
return $path;
|
||||
}
|
||||
|
||||
protected function prepareException(Throwable $e)
|
||||
{
|
||||
return $e;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue