I have a problem when I try to upload an image, well, when I submit on form it returns the following error:
Intervention\Image\Exception\NotWritableException
Can't write image data to path (public/images/products/2014-06-01-16:24:38-581165_571926502843010_889453779_n.jpg)
Well, I figured it might be a permission problem, I went there and gave permission on the directory, but the darned continues to make the same mistake. Here is my code:
public function postCreate(){
$validator = Validator::make(Input::all(),Product::$rules);
if($validator->passes()){
$product = new Product();
$product->category_id = Input::get('category_id');
$product->title = Input::get('title');
$product->description = Input::get('description');
$product->price = Input::get('price');
$product->availability = Input::get('availability');
$image = Input::file('image');
$filename = date('Y-m-d-H:i:s').'-'.$image->getClientOriginalName();
Image::make($image->getRealPath())->resize('468,249')->save('public/images/products/'.$filename);
$product->image = 'images/products/'.$filename;
$product->save();
return Redirect::to('admin/products/index')
->with('message','Produto cadastrado');
}
}