没有模型[modelName]的查询结果,laravel重定向错误

I'm having a problem where any input errors in my edit form is returning "No query results for model [modelName]" instead of generating validator messages like it should. Here are my codes:

PetController.php

public function update($id)
{
    //omited the validator messages cause it's too long, but it works cause I have an add function that uses the same thing.

    try {
        $pet = Pet::findOrFail(Input::get('id'));
    }
    catch(exception $e) {
        return Redirect::to('/pet')->with('flash_message', 'Error Editing Pet.');
    }

    $name = filter_var($_POST["name"], FILTER_SANITIZE_STRING);
    $breed = filter_var($_POST["breed"], FILTER_SANITIZE_STRING);
    $birthday = filter_var($_POST["birthday"], FILTER_SANITIZE_STRING);

    $pet->name = $name;
    $pet->breed = $breed;
    $pet->birthday = Pet::saveDateFmt($birthday);
    $pet->save();

    return Redirect::to('/pet')->with('flash_message','Your changes have been saved.');
}

So any input error with name, breed, or date will redirect me to /pet with the errors messages from this function:

public function edit($id){
    try {
        $pet    = Pet::findOrFail($id);
    }
    catch(exception $e) {
        return Redirect::to('/pet')
            ->with('flash_message', $e->getMessage());
            //this is where I get the error msg
    }

    return View::make('edit_pet', ['vet_list' => Vet::lists('name','id')])->with('pet', $pet);

}

I mean, I'm glad it's catching input errors but I don't want to redirect users back to the index page every time. I need to understand why is it redirecting this way to understand how to fix it.

So Update redirects you to Edit? If that is correct then you aren't passing in an id when you redirect causing it to try and find an id of null, try catching if id is null in your edit function.

Ok I just fixed it myself, so apparently I got the form wrong, I changed it to:

{{ Form::open(array('action' => array('PetController@update', $pet->id), 'method' => 'put')) }}