title: Database update - column not found laravel
body: <p>I am getting this error message:</p>
  
  <blockquote>
    <p>SQLSTATE[42S22]: Column not found: 1054 Unknown column '0' in 'field
    list' (SQL: update <code>handymen</code> set <code>0</code> = job_id, <code>1</code> = 2, <code>updated_at</code>
    = 2016-04-14 09:14:49 where <code>id</code> = 1)</p>
  </blockquote>
  
  <p>My db structure looks like this:</p>
  
  <pre><code>&lt;?php
  
  use Illuminate\Database\Schema\Blueprint;
  use Illuminate\Database\Migrations\Migration;
  
  class CreateHandymenTable extends Migration
  {
      /**
       * Run the migrations.
       *
       * @return void
       */
  public function up()
  {
      Schema::create('handymen', function (Blueprint $table) {
          $table-&gt;increments('id');
          $table-&gt;string('first_name');
          $table-&gt;string('last_name');
          $table-&gt;string('street');
          $table-&gt;string('postcode');
          $table-&gt;string('town');
          $table-&gt;string('skills');
  
  
          $table-&gt;integer('job_id')-&gt;unsigned();
          $table-&gt;foreign('job_id')-&gt;references('id')-&gt;on('jobs')-&gt;onDelete('cascade');
  
  
          $table-&gt;timestamps();
          });
      }
  /**
   * Reverse the migrations.
   *
   * @return void
   */
  public function down()
  {
      Schema::table('handymen', function (Blueprint $table) {
          $table-&gt;dropForeign('handymen_job_id_foreign');
          $table-&gt;dropColumn('job_id');
      });
      }
  }
  </code></pre>
  
  <hr>
  
  <p>Controller:</p>
  
  <pre><code>function jobassign(Request $request)
  {
       $job_id = $request-&gt;input('job_id');
       $handymanId = $request-&gt;input('handymanid');
      $job = Handyman::where('id', $handymanId)-&gt;update(['job_id', $job_id]);
      return redirect()-&gt;back()-&gt;with('status', trans('Handyman has been successfully assigned to this job.'));
      //return view('layouts/skilledHandyman', ['jobs' =&gt; $jobs, 'skilledHandyman' =&gt; $skilledHandyman]);
  }
      function skilledHandyman($handymanId)
  {
      $skilledHandyman = Handyman::find($handymanId);
      $jobs = Job::all();
      return view('layouts/skilledHandyman', ['jobs' =&gt; $jobs, 'skilledHandyman' =&gt; $skilledHandyman]);
  }
  </code></pre>
  
  <hr>
  
  <p>View:</p>
  
  <pre><code>@extends('layouts.master')
  
  @section('skilledHandyman')
  
  @section('content')
      &lt;h1&gt;Handyman details&lt;/h1&gt;
  &lt;ul&gt;
      &lt;li&gt;First Name:{{$skilledHandyman-&gt;first_name}}&lt;/li&gt;
      &lt;li&gt;Last Name:{{$skilledHandyman-&gt;last_name}}&lt;/li&gt;
      &lt;li&gt;Street:{{$skilledHandyman-&gt;street}}&lt;/li&gt;
      &lt;li&gt;Postcode:{{$skilledHandyman-&gt;postcode}}&lt;/li&gt;
      &lt;li&gt;Town:{{$skilledHandyman-&gt;town}}&lt;/li&gt;
      &lt;li&gt;Skills:{{$skilledHandyman-&gt;skills}}&lt;/li&gt;
  &lt;/ul&gt;
  
      &lt;form action="{{url('jobassign')}}" method="POST"&gt;
      {{ csrf_field() }}
       @foreach ($jobs as $job)
          &lt;div&gt;
              &lt;label&gt;{{$job-&gt;name}}&lt;/label&gt;
              &lt;input type='checkbox' value='{{$job-&gt;id}}' name='job_id'/&gt;
              &lt;input type="hidden" name="handymanid" value="{{$skilledHandyman-&gt;id}}"&gt;
          &lt;/div&gt;
      @endforeach
      &lt;input type="submit" name="submitBtn" value="Assign Job"&gt;
  &lt;/form&gt;
  @endsection
  </code></pre>
  
  <p>Can someone tell me why is this happening and how to fix it please?</p>
  
  <p>Thank You</p>