Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

bubayko's avatar

I cant see my images

SOLVED It turns out my model's fillable was 'image' not 'image_path' SOLVED


I was getting from chrome 403 error but now it got changed when i moved my project inside wamp64/www hence now i get 404 not found error. I have public/storage/news folder and able to see images both of the folders (public and storage) but i cant display name beside of it default placeholder appears.

Controller

0 likes
5 replies
bubayko's avatar

when i tried to share my code preview blocked them how can i paste them like others?

theartisandev's avatar

As an unsolicited side note (🙃) if you move the validation logic to its own class like NewsRequest, it could help cut down the duplicated code in the store() and update() methods:

$validated = $request->validate([
    'title' => 'required|string|max:255',
    'description' => 'required|string',
    'image' => 'nullable|image|max:2048',
    'club_id' => 'required|exists:clubs,id',
]);

Becomes:

public function store(NewsRequest $request)
{
    //...
}
public function update(NewsRequest $request, News $news)
{
    //...
}

I find that doing that and creating separate single-action classes to handle the CRUD logic help keep the Controllers nice and lean.

1 like

Please or to participate in this conversation.