Iam Deploy my project web on shared hosting . and following tutorial to move all on the public(local) folder to public_html(hosting)
my Structure
(/home/sippausr)
laravel
logs
public_ftp
public_html ->
css
files
home
images
js
kalibrasi
public
sop
theme
and now i have a controller to send this data to folder files
My Controller
public function store6(Request $request)
{
$this->validate($request, [
]);
if($request->hasfile('image'))
{ $file = $request->file('image');
$name=$file->getClientOriginalName();
$file->move(public_path().'/files/', $name);// i think this problem on here
$data = $name;
}
$user = new pemeliharaan;
$id = Auth::user()->id;
$user->user_id = $id;
$user->alat_id = $request->alat_id;
$user->pertanyaan =json_encode($request->except
(['_token','name','alat_id','status','catatan','image']));
$user->catatan = $request->catatan;
$user->image=$data;
$user->status = $request->status;
$user->save();
// dd($user);
return redirect('user/show6')->with('success', 'Data Telah Terinput');
}
but this image cant saved at directory files . this name image is saved on database , but this file is not saved . how i can fix this ?