Level 122
seriously?
$filename = time() . 'thumbnail.' . $image->getClientOriginalExtension();
2 likes
I would like to add a word to my filename, how can I do that?
$image = $request->file('image');
$filename = time() . '.' . $image->getClientOriginalExtension();
$location = ('storage/'. Auth::id() .'/posts/image/' . $filename);
File::makeDirectory('storage/'. Auth::id() .'/posts/image/', 0775, true, true);
Image::make($image)->save($location);
$post->image = ('/'. Auth::id() .'/posts/image/' . $filename);
the filename after the upload consists only of numbers and I would like to add the word "thumbnail" to the filename at the end.
seriously?
$filename = time() . 'thumbnail.' . $image->getClientOriginalExtension();
Please or to participate in this conversation.