Level 102
Do you get any sort of errors ? Check in laravel.log
Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.
On my Laravel Local Server this code works
private function storeImage($news)
{
if (request()->has('image')){
$original = request()->file('image')->getClientOriginalName();
$news->update([
'image' => request()->file('image')->storeAs('uploads', $original),
]);
$image = Image::make(public_path('image/'. $news->image))->resize(664, 373);
$image->save();
}
}
But on my Shared Hosting Server it does not save the image or even the post into the database... Meanwhile making a post without images saves into the database
Please or to participate in this conversation.