0
I am using the image Intervention is this all working, my doubt and I would like to remove the saved photos from the public folder not to be accessed by the URL or protect the access by the URL for safety sake would anyone know how to do ? That is my Code ::
public function update_avatar(Request $request){
// Controle do upload do usuário do avatar
if($request->hasFile('avatar')){
$avatar = $request->file('avatar');
$filename = time() . '.' . $avatar->getClientOriginalExtension();
Image::make($avatar)>resize(300, 300)>save( public_path('/uploads/avatars/' . $filename ) );
$user = Auth::user();
$user->avatar = $filename;
$user->save();
}
return view('profile', array('user' => Auth::user()) );
}/fim da function para fazer upload de imagens/
You can place a watermark on the image or restrict its access through the URL by uploading it to the Laravel Storage, however, I don’t know how the performance will be. , if you want the second option, you can follow this answer: http://stackoverflow.com/questions/30682421/how-to-protect-image-public-view-in-laravel-5
– Diego Schmidt
Thanks! I’ll try the second option
– Ronnyere Andrade