异常:"SymfonyComponentHttpKernelExceptionNotFoundHttpException" ,...}



我的php模型中有这个脚本:

private function getAcciones() : array
{
$base_url = url(config('backpack.base.route_prefix'));
$todas_las_acciones = [
[
'condition' => $this->isDeletable(),
'action'    => '
<script type="text/javascript">
function deleteComplementoPago( id ){
Swal.fire({
title: '¿Esta segura/o de eliminar este complemento de pago?',
type: 'warning',
showCancelButton: true,
confirmButtonColor: '#3085d6',
cancelButtonColor: '#d33',
confirmButtonText: 'Si, confirmar',
showLoaderOnConfirm: true,

}).then((result) => {
if( result.value ){
$.ajax({
type: "POST",
url: "/webapi/finanzas/complemento/pago/" + id + "/delete",
data: { pago_id: id },
success: function(data){
console.log(data)
window.location.replace("' . $base_url . '/finanzas/complemento/pago");
}
})                                          
}
});
}
</script>
<li><a onclick="deleteComplementoPago(''.$this->id.'')"><i class="fa fa-times"></i> Borrar </a></li>'
]
];
$result = [];
foreach ($todas_las_acciones as $accion){
if($accion['condition']){
$result[] = $accion['action'];
}
}
return $result;
}

我在我的web.php 中有这个

Route::get('finanzas/complemento/pago/{pago}/delete', 'PagoCrudController@deletePago');

我只想让swal.fire出现,并询问客户是否真的想删除该项目,但我收到了这个错误:

{消息:",异常:"Symfony\Component\HttpKernel\exception\NotFoundHttpException",…}例外:";Symfony\Component\HttpKernel\Exception\NotFoundHttpException"文件:"/Users/rodri6uez/Documents/LARAVEL/HIPO/vendor/laraavel/framework/src/IIlluminate/Routing/RouteCollection.php";线路:179消息:"trace:[{,…},{,..},{,…},{…}

这是我的控制器上的东西:

public function deletePago(Pago $pago){
try{
DB::beginTransaction();
$pagos_factura = $pago->pago_facturas()->get();
foreach ($pagos_factura as $pago_factura){
$abono = Abono::withTrashed()->where('origen_id', $pago_factura->id)
->where('tipo', 'Complemento pago')
->first();
if( isset($abono) ) $this->borrar_abono($abono);
$pago_factura->delete();
}
$pago->delete();
DB::commit();
Alert::success(trans("Complemento de pago borrado con exito"))->flash();
return redirect('admin/finanzas/complemento/pago');
}catch (Exception $e){
DB::rollBack();
Alert::error(trans($e->getMessage()))->flash();
return redirect('admin/finanzas/complemento/pago');
}
}

你能帮我吗?我看不出我的错误是什么。

NotFoundHttpException表示您提供的路由url无效,请检查url是否存在于routes/web.php

相关内容

  • 没有找到相关文章

最新更新