"Route [demanda.estado.update] not defined" but exists in the resource controller, Laravel 5.4

2

StateController

public function edit($id)
    {
        $estado=Estado::findOrFail($id);
        return view("demandas.estado.edit",["estado"=>Estado::findOrFail($id)]);
    }


    public function update(EstadoFormRequest $request, $id)
    {
        $estado=Estado::findOrFail($id);
        $estado->nombreEstado = $request->get('nombreEstado');
        $estado->update();
        return Redirect::to('demandas/estado');
    }

model

protected $table = 'estados';

route:

Route::resource('demandas/estado','EstadoController');

Form model in edit.blade.php:

{!!Form::model($juzgado,['method'=>'PATCH','route'=>['demandas.juzgado.update',$juzgado->idJuzgado],'files'=>'true'])!!}
 I get the exception  Route [demands.estado.update] not defined. resources \ views \ demands \ status \ edit.blade.php I do not understand how the route is not defined What am I doing wrong? Thank you!     
asked by Jhonatan Valencia 28.09.2017 в 15:48
source

1 answer

0

If you look at the result of php artisan route:list , the name of the route is estado.update and not demandas.estado.update , I'm not sure but maybe it's because of the use of the oblique bar that Laravel only takes the last word to define the name of the route.

Test php artisan route:clear in case the name does not appear "correctly" by cache issue.

    
answered by 28.09.2017 / 16:14
source