**how to create image thumbnails i use different library but thumbnail not create **
public function store(Request $request){
$user_id = \Auth::user()->id;
$image = new Image();
$this->validate($request, [
'title' => 'required',
'description' => 'required',
'image' => 'required'
]);
$image->title = $request->title;
$image->description = $request->description;
$image->user_id = $user_id;
if($request->hasFile('image')) {
$file = Input::file('image');
//getting timestamp
$timestamp = str_replace([' ', ':'], '-', Carbon::now()->toDateTimeString());
$name = $timestamp. '-' .$file->getClientOriginalName();
$image->filePath = $name;
$file->move(public_path().'/images/', $name);
}
$image->save();
return $this->upload()->with('success', 'Image Uploaded Successfully');
}
** **how to create image thumbnails i use different library but thumbnail not create ****
from Newest questions tagged laravel-5 - Stack Overflow http://ift.tt/1m0dvOZ
via IFTTT
Aucun commentaire:
Enregistrer un commentaire