jeudi 2 décembre 2021

The image that i uploaded in my post is diplaying broken image i dont know why it is not working i crate public/storage /posts folder using the cmds

i am using laravel 5.8 and the image that i uploaded is displaying in broken format the is here

 public function store(createpostrequest $request)
    {
        $image=$request->image->store('posts');
       $post = post::create([
            'title'=>$request->title,
            'description'=>$request->description,
            'content'=>$request->content,
            'image'=>$image,
            'published_at'=>$request->published_at,
            'catagory_id'=>$request->catagory
        ]);

       if ($request->tags) {
           $post->tags()->attach($request->tags);
       }

        //flashing the message

        session()->flash('success','Post created successfully');
        return redirect(route('posts.index'));
    }   

and in the post index page

                    ```
image)}}"> ``` but the image is that displaying in the page is broken when i remove the asset() it displays the image that is store in public/storage/post .........but i cant open this folder ........

via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire