dimanche 5 juin 2022

image not display in admin panel

Image not display why in laravel, what is the issue controller nd blade is added Controller code

 try{

      $file=$request->file('image');
      $filename=$file->getClientOriginalName();
      $imgname = uniqid().$filename;

      $input['image']= $imgname;
      $destinationPath=public_path('upload/image/');
      $request->file('image')->move($destinationPath, $imgname);

  
        Auth::user();
        $article =  new Article();
        $article -> user_id=Auth::user()->id;
        $article -> title=$request->get('title');
        $article -> description=$request->get('description');
        $article-> image = $filename;
        $article -> status=$request->get('status');
        $article->save();
    $request->session()->flash('alert-success','article has been sucessfully created.');
    return back()->with('success', 'Article created successfully.');   
    }
catch(ModelNotFoundException $exception){
   // do task when error
    return back()->withError($exception->getMessage())->withInput();    }

}

in blade file print this code

 <td><img src=""
                                            width="500px"></td>


via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire