Problems with laravel routes

1

I have problems with laravel routes I can not access the destroy method and if the routes are defined I leave the code and some screenshots

Listing

<table id="example1" class="table table-bordered table-striped text-center">
                                <thead>
                                    <tr>
                                        <th>Codigo</th>
                                        <th>Apellido</th>
                                        <th>Nombre</th>
                                        <th>Telefono</th>
                                        <th>Celular</th>
                                        <th>Domicilio</th>
                                        <th>eMail</th>
                                        <th>Opciones</th>
                                    </tr>
                                </thead>
                                <tbody>
                                    @foreach($locatorios as $row)
                                        <tr>
                                            <td>{{ $row->idLocatario }}</td>
                                            <td>{{ $row->Apellido }}</td>
                                            <td>{{ $row->Nombre }}</td>
                                            <td>{{ $row->Telefonos }}</td>
                                            <td>{{ $row->Celulares }}</td>
                                            <td>{{ $row->Domicilio." ".$row->Localidad ." ".$row->Partido }}</td>
                                            <td>{{ $row->EMail }}</td>
                                            <td>

                                                <a href="{{ route('locatorio.edit', $row->idLocatario) }}" style="color:#000;text-decoration:none;"><i style="font-size: 18px;" class="fa fa-pencil" title="Editar"></i></a>

                                                <a href="" data-target="#modal-delete-{{$row->idLocatario}}" data-toggle="modal"><i style="font-size: 18px;" class="fa fa-remove" title="Eliminar"></i></a>

                                            </td>
                                        </tr>

                                        @include('fragment.modal')

                                    @endforeach
                                </tfoot>
                            </table>

MODAL

<div class="modal face modal-slide-in-right" aria-hidden="true" role="dialog" tabindex="-1" id="modal-delete-{{ $row->idLocatario }}">

    {{Form::open(array('action'=>array('locatorio.destroy', $row->idLocatario), 'method'=>'delete')) }}

        <div class="modal-dialog">
            <div class="modal-content">
                <div class="modal-header">
                    <button type="button" class="close" data-dismiss="modal" aria-label="Close">
                        <span aria-hidden="true">x</span>
                    </button>
                    <h4 class="modal-title">Eliminar</h4>
                </div>

                <div class="modal-body">
                        <p>Está seguro de procesar la baja de este Locatario?</p>
                </div>
                <div class="modal-footer">
                    <button type="button" class="btn btn-default pull-left" data-dismiss="modal">No</button>

                    <button type="submit" class="btn btn-primary pull-right">Si</button>

                </div>
            </div>
        </div>

    {{Form::Close()}}

</div>

    
asked by Oswuell 17.08.2017 в 21:06
source

1 answer

1

Well, the only bad thing is your form tag:

  

{{Form: open (array ('action' = > array ('locatorio.destroy', $ row-> idLocatario), 'method' = > 'delete'))}}

must be in the following way:

{{Form::open(['route'=>['locatorio.destroy', $row->idLocatario], 'method'=>'delete']) }}

I hope you'll be lucky.

    
answered by 17.08.2017 / 21:24
source