title: How to edit image and update in laravel
body: <p>I have a table called Services, now this table has the following -</p>
  
  <p>-id
  -title
  -body
  -image
  -slug
  -timestamps</p>
  
  <p>And in administrator, services page I created for Add, Edit, Delete it. </p>
  
  <p>My problem is <code>edit</code> and <code>update</code> a image. A strange problem is that, when I change the of <code>image</code> to <code>aaaaa</code> field in the service table (database), Nothing happens. should happen. because I changed rename of <code>image</code> to <code>aaaaa</code>.</p>
  
  <p>web.php</p>
  
  <pre><code>Route::resource('services', 'ServiceController');
  </code></pre>
  
  <p>ServiceController.php</p>
  
  <pre><code>public function edit(Service $service)
  {
      return view('Admin.services.edit', compact('service'));
  }
  
  public function update(Request $request, Service $service)
  {
      $service-&gt;title = $request-&gt;title;
      $service-&gt;body = $request-&gt;body;
  
      if($request-&gt;has('image')) {
          $image = $request-&gt;file('image');
          $filename = $image-&gt;getClientOriginalName();
          $image-&gt;move(public_path('images/services'), $filename);
          $service-&gt;image = $request-&gt;file('image')-&gt;getClientOriginalName();
      }
  
      $service-&gt;update();
  
      return redirect()-&gt;route('services.index');
  }
  </code></pre>
  
  <p>edit.blade.php</p>
  
  <pre><code>&lt;form class="form-horizontal" action="{{ route('services.update', $service-&gt;id) }}" method="post" enctype="multipart/form-data"&gt;
      {{ csrf_field() }}
      {{ method_field('PATCH') }}
      @include('Admin.layouts.errors')
      &lt;div class="form-group"&gt;
          &lt;label for="title"&gt;عنوان&lt;/label&gt;
          &lt;input type="text" class="form-control" id="title" name="title" placeholder="عنوان" value="{{ $service-&gt;title ? : old('title') }}"&gt;
      &lt;/div&gt;
      &lt;div class="form-group"&gt;
          &lt;label for="body"&gt;متن&lt;/label&gt;
          &lt;textarea class="form-control" rows="10" id="body" name="body" placeholder="متن"&gt;{{ $service-&gt;body ? : old('body') }}&lt;/textarea&gt;
      &lt;/div&gt;
      &lt;div class="form-group"&gt;
          &lt;label for="images"&gt;تصویر&lt;/label&gt;
          &lt;div class="custom-file"&gt;
              &lt;input type="file" class="custom-file-input" id="images" name="images"&gt;
              &lt;label class="custom-file-label" for="images"&gt;تصویر محصول&lt;/label&gt;
          &lt;/div&gt;
      &lt;/div&gt;
      &lt;div class="form-group"&gt;
          &lt;button type="submit" class="btn btn-primary"&gt;ذخیره&lt;/button&gt;
      &lt;/div&gt;
  &lt;/form&gt;
  </code></pre>
  
  <p>Service.php</p>
  
  <pre><code>protected $fillable = [
      'title',
      'body',
      'image',
      'slug',
  ];
  </code></pre>
  
  <p>I even changed the controller in the <code>update</code> method as follows, nothing happened.</p>
  
  <pre><code>$service-&gt;save(); 
  </code></pre>