Handler.php第102行中的NotFoundHttpException:模型[App \ ...]没有查询结果

I tried to edit/update my data in database. But always get this error.

NotFoundHttpException in Handler.php line 102: No query results for model [App\Produk]

Here's the function in controller:

public function edit($id)
{
    $data = Produk::findOrFail($id);
    return view('pages.admin.edit')->with('data',$data);
}
public function update($id, Request $request)
{
    $data = Produk::findOrFail($id);
    $data->update($request->all());
    return redirect('pages.admin.lihat');
}

And here's my edit.blade.php form:

    {!! Form::model($data,['method'=>'PATCH','url' => 'admin/update']) !!}

<div class="contact-form">
<div class="form-group">
    {!! Form::label('Nama Produk') !!}
    {!! Form::text('nama', null, 
        array('required', 
              'class'=>'form-control', 
              'placeholder'=>'Nama Produk')) !!}
</div>

<div class="form-group">
    {!! Form::label('Jumlah Produk') !!}
    {!! Form::number('jumlah', null, 
        array('required', 
              'class'=>'form-control', 
              'placeholder'=>'Jumlah Produk')) !!}
</div>

<div class="form-group">
    {!! Form::label('Harga') !!}
    {!! Form::text('harga', null, 
        array('required', 
              'class'=>'form-control', 
              'placeholder'=>'Harga')) !!}
</div>

<div class="form-group">
    {!! Form::label('Gambar') !!}
    {!! Form::text('images', null, 
        array('required', 
              'class'=>'form-control', 
              'placeholder'=>'Gambar')) !!}
</div>

<div class="form-group">
    {!! Form::submit('Edit', 
      array('class'=>'btn btn-primary')) !!}
</div>

</div>
{!! Form::close() !!}

I use this in my routes (the first one is for the store function so nothing to do with this update):

Route::post('admin/success','ProdukController@simpan');

Route::resource('admin','ProdukController');

And the Produk Model:

<?php

namespace App;

use Illuminate\Database\Eloquent\Model;

class Produk extends Model
{
    protected $fillable =[

        'nama',
        'jumlah',
        'harga',
        'images'

    ];
}

that happens cause data with that id doesn't exits $data = Produk::findOrFail($id) . you can use Produk::find($id);or data = Produk::where('id', $id)->first(); (it won't throw an error)

read more at documentation

You should pass the id to the url on form opening try to change it as follow:

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