In my server, I get this error message
Unable to write in the "/home/company/blog/public/img" directory
When I try to upload an image like this in my controller
$file = $request->file('img');
$name = time() . '-' . $file->getClientOriginalName();
$file->move(public_path() .'/img/', $name);
$company = company::where('username', $username)->first();
$company->images()->create(['path' => "/{$name}"]);
I know it's about granting permissions I tried
chmod 755 /home/company/blog/public/img
But it still doesn't work.
How can I resolve this?