APIs and external services

2 days ago
Thank you! Your submission has been received!
Oops! Something went wrong while submitting the form.

All Discussions

-

Not able to delete image file in Laravel

Iam trying to delete an image file but its giving error that call to a member function delete() on string.

This is my code:

public function destroy($id)    {            $element = Element::find($id);        $destination = 'public/images/'.$element->imagen;        if(File::exists($destination)){            File::delete($destination);        }        $destination->delete();        return redirect()->route('elements.index');    }    }


-
APIs and external services
-

Avoiding Common Pitfalls When Building APIs with Laravel

What are the points we should remember while working on APIs ?

-
APIs and external services

Post your issue

Category
Topic
Description
Your post has been created! We are redirecting you to your live post. This might take a few seconds.
Thank you! Your post has been received. Once approved, you will receive an email with a link to your live post.
Oops! Something went wrong while submitting the form.

© 2025 by CodeBloom Education Ltd