jeudi 2 février 2017

Laravel 5.0 Update form not working

I have a form::model I created when a record is selected information is displayed in a form if I want to edit it, I get an error. That says:

exception 'InvalidArgumentException' with message 'Route [test/edit] not defined.' in /www/testsite/vendor/laravel/framework/src/Illuminate/Routing/UrlGenerator.php:306

routes.php

Route::any('test/edit','Test\testController@edit');

edit.blade.php

{!! Form::model($display,array('url' =>  array('test/edit',$display->myID),'method' => 'put')) !!}


                    {!! Form::label('myID', 'My ID') !!}
                    {!! Form::text('myID') !!}

                        {!! Form::label('topic', 'Topic') !!}
                        {!! Form::text('topic') !!}
                        <br>
                        {!! Form::label('describe', 'describe') !!}
                        {!! Form::text('describe') !!}
                        <br>
   {!! Form::submit('Update') !!}

                        {!! Form::close() !!}

testController.php

public function edit($id,Request $request)
    {
       $myID = $request->myID;
       $topic = $request->topic;
       $descibe = $request->descibe;

       $validator = \Validator::make(
           array(
               'myID' => $myID,
               'topic' => $topic,
               'descibe' => $descibe
           ), array(
               'myID' => 'required|min:1',
               'topic' => 'required|min:2',
               'descibe' => 'required|min5'
           )
       );
$test = Test::find($id);
         $test->save();
}



from Newest questions tagged laravel-5 - Stack Overflow http://ift.tt/2kx91CC
via IFTTT

Aucun commentaire:

Enregistrer un commentaire