public function store(Request $request)
{
$request->merge(['slug' => Str::slug($request->baslik), 'user_id' => auth()->user()->id, 'hit' => 0 ]);
$add = Ilan::create($request->post());
$insertedId = $add->id;
if($files=$request->file('images')){
foreach($files as $file){
$photo = new Photo;
$name=rand(0,4000).'-'.Str::slug($request->baslik).'-'.$file->getClientOriginalName();
$file->move(public_path('uploads'),$name);
$photo->ilan_id = $insertedId;
$photo->url = 'uploads/'.$name;
$photo->save();
}
}
return redirect()->route('ilan.index');
}
This is my function. It's working in Local. But when I try it in a server it's not working. Image is not creating and there is no error. Where is the problem, if you help me i will be glad, thank you.
My public folder is: sample.com/references/website
I didnt send public folder to the main folder