title: Intervention \ Image \ Exception \ ImageNotWritableException using Laravel 4
body: <p>I am using Laravel 4. I am not sure why I am getting this error when everything seems to be correct. Also, the product is not updating to the database.   </p>
  
  <blockquote>
    <p>Error: Intervention \ Image \ Exception \ ImageNotWritableException
    Can't write image data to path [/img/products/1396668877.jpg]</p>
  </blockquote>
  
  <p>Snippet of <strong>ProductsController</strong> where product object is created:</p>
  
  <pre><code>public function postCreate() {
      $validator = Validator::make(Input::all(), Product::$rules);
  
      if ($validator-&gt;passes()) {
          $product = new Product;
          $product-&gt;category_id = Input::get('category_id');
          $product-&gt;title = Input::get('title');
          $product-&gt;description = Input::get('description');
          $product-&gt;price = Input::get('price');
  
          $image = Input::file('image');
          $filename  = time() . '.' . $image-&gt;getClientOriginalExtension();
          Image::make($image-&gt;getRealPath())-&gt;resize(468, 249)-&gt;save('/img/products/'.$filename);
          $product-&gt;image = 'img/products/'.$filename;
          $product-&gt;save();
  
          return Redirect::to('admin/products/index')
              -&gt;with('message', 'Product Created');
      }
  
      return Redirect::to('admin/products/index')
          -&gt;with('message', 'Something went wrong')
          -&gt;withErrors($validator)
          -&gt;withInput();
  }
  </code></pre>
  
  <p>product object passed to <strong><em>view</em></strong></p>
  
  <pre><code>@foreach($products as $product)
                  &lt;li&gt;
                      {{ HTML::image($product-&gt;image, $product-&gt;title, array('width'=&gt;'50')) }} 
                      {{ $product-&gt;title }} - 
                      {{ Form::open(array('url'=&gt;'admin/products/destroy', 'class'=&gt;'form-inline')) }}
                      {{ Form::hidden('id', $product-&gt;id) }}
                      {{ Form::submit('delete') }}
                      {{ Form::close() }} - 
  
                  {{ Form::open(array('url'=&gt;'admin/products/toggle-availability', 'class'=&gt;'form-inline'))}}
                  {{ Form::hidden('id', $product-&gt;id) }}
                  {{ Form::select('availability', array('1'=&gt;'In Stock', '0'=&gt;'Out of Stock'), $product-&gt;availability) }}
                  {{ Form::submit('Update') }}
                  {{ Form::close() }}
              &lt;/li&gt;
          @endforeach
  </code></pre>
  
  <p>Products <strong><em>Model</em></strong></p>
  
  <pre><code>&lt;?php
  
  class Product extends Eloquent {
  
      protected $fillable = array('category_id', 'title', 'description', 'price', 'availability', 'image');
  
      public static $rules = array(
          'category_id'=&gt;'required|integer',
          'title'=&gt;'required|min:2',
          'description'=&gt;'required|min:20',
          'price'=&gt;'required|numeric',
          'availability'=&gt;'integer',
          'image'=&gt;'required|image|mimes:jpeg,jpg,bmp,png,gif'
      );
  
      public function category() {
          return $this-&gt;belongsTo('Category');
      }
  }
  </code></pre>
  
  <p><em>products</em> table in the <strong><em>database</em></strong></p>
  
  <pre><code>    public function up()
          {
              Schema::create('products', function($table){
                  $table-&gt;increments('id');
                  $table-&gt;integer('category_id')-&gt;unsigned();
                  $table-&gt;foreign('category_id')-&gt;references('id')-&gt;on('categories');
                  $table-&gt;string('title');
                  $table-&gt;text('description');
                  $table-&gt;decimal('price', 6, 2);
                  $table-&gt;boolean('availability')-&gt;default(1);
                  $table-&gt;string('image');
                  $table-&gt;timestamps();
              });
          }
  </code></pre>