laravel在本地主机和托管之间的问题

时间:2018-11-12 18:22:02

标签: laravel laravel-5.7

我有下一个问题,我在本地计算机上的Laravel 5.7中有一个项目,然后将此项目上传到Bluehost上的Hosting,问题是: 我的本地主机中有viewcustomers.blade.php文件,可以正常运行,但是没有问题,但是在我的主机中,此文件不起作用...

这是代码:

@foreach($prendas as $prenda)
                            @if($clientes->id == $prenda->idcliente)
                                <tr>
                                    <td align="center"><img src="../images/clientes/{{$clientes->nombre}} {{$clientes->apellido}}/{{$prenda->fotoprenda1}}" width="150"></td>
                                    <td align="center">{{$prenda->prenda}}</td>
                                    <td align="center">{{$prenda->marca}}</td>
                                    <td align="center">{{$prenda->modelo}}</td>
                                    <td align="center">{{$prenda->anio}}</td>
                                    <td align="center">$  {{$prenda->limitcredit}}</td>
                                    @if($prenda->status == "Sin Prestamos")
                                        <td bgcolor="green">Sin Prestamos</td>
                                        <td><a href="{{url('/addpawn/'.$prenda->idcliente."/".$prenda->id)}}" class="btn btn-danger">Agregar Prestamo</a></td>
                                    @elseif ($prenda->status == "En Empeño" and $prenda->restcredit < $prenda->limitcredit)
                                        <td bgcolor="red">Empeñada</td>
                                        <td><a href="{{url('/addmorepawn/'.$prenda->idcliente."/".$prenda->id)}}" class="btn btn-danger">Agregar Prestamo</a></td>
                                    @elseif ($prenda->status == "En Empeño" and $prenda->restcredit >= $prenda->limitcredit)
                                        <td bgcolor="red">Empeñada</td>
                                        <td>Sin Limite de Credito</td>
                                    @endif

                                </tr>
                            @endif
                        @endforeach
                        <tr>
                            <td>       </td></tr>
                    </table>
                </div>
                <div class="col-sm-12">
                    <h3 class="text-center">Prestamos Actuales</h3>
                    <hr>
                    <center>
                        @if($prenda->status == "Sin Prestamos" and $clientes->id == $prenda->idcliente)
                           <a href="{{url('/addpawn/'.$prenda->idcliente."/".$prenda->id)}}" class="btn btn-danger">Agregar Prestamo</a>
                        @elseif ($prenda->status == "En Empeño" and $prenda->restcredit < $prenda->limitcredit and $clientes->id == $prenda->idcliente)

                           <a href="{{url('/addmorepawn/'.$prenda->idcliente."/".$prenda->id)}}" class="btn btn-danger">Agregar Prestamo</a>

                        @elseif ($prenda->status == "En Empeño" and $prenda->restcredit >= $prenda->limitcredit and $clientes->id == $prenda->idcliente)
                            <h2 class="text-danger">Sin Limite de Credito</h2>
                        @endif

这是托管中的问题

  状态==“ Sin Prestamos”和$ clientes-> id ==   $ prenda-> idcliente):?>                              idcliente。“ /”。$ prenda-> id)); ?>“ class =” btn   btn-danger“> Agregar Prestamo                           状态==“ EnEmpeño”和$ prenda-> restcredit limitcredit和$ clientes-> id ==   $ prenda-> idcliente):?>
                       <a href="<?php echo e(url('/addmorepawn/'.$prenda->idcliente."/".$prenda->id)); ?>"
     

class =“ btn btn-danger”>阿格里加·普雷斯塔莫

                    <?php elseif($prenda->status == "En Empeño" and $prenda->restcredit >= $prenda->limitcredit and $clientes->id ==
     

$ prenda-> idcliente):?>                               罪恶极限                                                                                                                          Fecha Prestamo                               帕雷斯塔达城                               普拉佐                               Interes                               帕果·昆森                               Fecha Primer Pago                               共有Pagar Prestamo                               状态                               Boleta deEmpeño参数“未定义变量:prenda(查看:   /home/thealmfc/public_html/lonchedeadobada.xyz/resources/views/viewcustomers.blade.php)“

有什么主意吗?谢谢

2 个答案:

答案 0 :(得分:0)

您的主机和主机之间的错误级别不同。 设置

error_reporting(E_ALL); ini_set('display_errors', 1);

在您的本地主机上,您将看到相同的问题

答案 1 :(得分:0)

检查您的代码,您错误地关闭了@foreach

<div class="col-sm-12">
<h3 class="text-center">Prestamos Actuales</h3>
<hr>
<center>
    @if($prenda->status == "Sin Prestamos" and $clientes->id == $prenda->idcliente)
        <a href="{{url('/addpawn/'.$prenda->idcliente."/".$prenda->id)}}" class="btn btn-danger">Agregar Prestamo</a>
    @elseif ($prenda->status == "En Empeño" and $prenda->restcredit < $prenda->limitcredit and $clientes->id == $prenda->idcliente)

        <a href="{{url('/addmorepawn/'.$prenda->idcliente."/".$prenda->id)}}" class="btn btn-danger">Agregar Prestamo</a>

    @elseif ($prenda->status == "En Empeño" and $prenda->restcredit >= $prenda->limitcredit and $clientes->id == $prenda->idcliente)
        <h2 class="text-danger">Sin Limite de Credito</h2>
    @endif

此处的变量$prenda超出范围。您在此代码段之前关闭了@foreach