Laravel 8, image url rerieved from database does not return image


I have been struggling with this problem for quite a few hours. My problem is that I have an image url saved in my database and when i retrieve it I try to display it in my index.blade.php. The weird part is I had used the same code in an older project and it worked, but I turned on the older project and it does not work there anymore either. I have done php artisan storage:link and from what i see the link is correct but the images are displayed as broken, I have looked up various solution but all of it lead to a dead end, because the url just doesnt want to display the image. The image url is saved in this form

My index.blade.php tbody

    @foreach($companies as $company)
            <td scope="row">{{$company->id}}</td>
            <td><img class="class='img-fluid rounded mb-3 mb-lg-0 ml-md-0" src="{{$company->logo}}"></td>
                <a href="{{route('company.edit', $company->id)}}" class="float-left">
                    <button type="button"
                            class="btn btn-primary mr-2">{{__('Edit')}}</button>
                <form action="{{route('company.delete',$company->id)}}" method="POST"
                    <button type="submit"
                            class="btn btn-danger btn-sn">{{__('Delete')}}</button>

How I call it from my Companiescontroller

 public function index(): Renderable
    $companies = $this->company->all();

    return view('company.index', compact('companies'));

How I store my image url

   public function store(Request $request): RedirectResponse
        'name' => 'required',
        'email' => '',
        'logo' => 'dimensions:min_width:100,min_height:100',
        'url' => ''
    $parameters = $request->all();
    if ($request->logo !== null) {
        $image = $request->logo->store('public');
        $parameters['logo'] = URL::to('/') . '/storage/' . $image;

    return redirect()->route('company.index');

I am not sure if this is enough, but i guess these are primary parts.

Source: Laravel

Leave a Reply