2
votes
  1. i got the issue while updateing NotFoundHttpException in RouteCollection.php line 161: in RouteCollection.php line 161 at RouteCollection->match(object(Request)) in Router.php line 821 at Router->findRoute(object(Request)) in Router.php line 691 at Router->dispatchToRoute(object(Request)) in Router.php line 675
    at Router->dispatch(object(Request)) in Kernel.php line 246 at Kernel->Illuminate\Foundation\Http{closure}(object(Request)) at call_user_func(object(Closure), object(Request)) in Pipeline.php line 52 at Pipeline->Illuminate\Routing{closure}(object(Request)) in CheckForMaintenanceMode.php line 44 at CheckForMaintenanceMode->handle(object(Request), object(Closure))
    at call_user_func_array(array(object(CheckForMaintenanceMode), 'handle'), array(object(Request), object(Closure))) in Pipeline.php line 136 at Pipeline->Illuminate\Pipeline{closure}(object(Request)) at call_user_func(object(Closure), object(Request)) in Pipeline.php line 32 at Pipeline->Illuminate\Routing{closure}(object(Request)) at call_user_func(object(Closure), object(Request)) in Pipeline.php line 103 at Pipeline->then(object(Closure)) in Kernel.php line 132 at Kernel->sendRequestThroughRouter(object(Request)) in Kernel.php line 99 at Kernel->handle(object(Request)) in index.php line 54

For the given issue Here is my Controller

public function update(Request $request ,$id){

        print_r($request);
        return redirect()->back();
    }

View

{!! Form::model($website, ['method' => 'PATCH   ', 'route' => ['websites.update', $website->id]]) !!}`
<div class="form-group">
{{ Form::label('user', 'User Name:', ['class' => 'control-label']) }}
{{ Form::text('user', null, ['class' => 'form-control']) }}
    </div>
{!! Form::submit('Update', ['class' => 'btn btn-primary']) !!}
{!! Form::close() !!}

Here My route

  Route::post('websites/{id}/update',
    ['as' => 'websites.update', 'uses' => 'WebsiteController@update']
);
2
you can send id from hidden fieldD Coder
still not working... will u please elaborate it so i can understand itcool Quazi
You are using method patch but route is post, they should be the same. Either patch or post, but the same.alariva
use route like website-updateD Coder

2 Answers

1
votes

Thanks For every one to helping me out. But i Uses this and now it is work fine. Thanks again!!

 {!! Form::model($website, ['method' => 'PATCH', 'route' => ['websites.update', $website->id]]) !!}`
        .
        .
        .


        Route::any('websites/{id}/update',
            ['as' => 'websites.update', 'uses' => 'WebsiteController@update']
        );
0
votes

Your method differs and should be the same as route Let's change like this:

{!! Form::model($website, ['method' => 'PUT', 'route' => ['websites.update', $website->id]]) !!}`
.
.
.


Route::PUT('websites/{id}/update',
    ['as' => 'websites.update', 'uses' => 'WebsiteController@update']
);