mercredi 26 décembre 2018

How i get image from database to view file in laravel

 <img  src=""  width="140" height="140">

this is the line which i use to get image from database to view file

i use bellow controller to get this image

public function show($id)
{

    $post=Clients::find($id);
    return view('pet.shw',['post'=>$post,'pets'=>$post->pets]); }

and also migration file is shown bellow

public function up()
{
    Schema::create('clients', function (Blueprint $table) {
        $table->increments('id');
        $table->string('ename');
        $table->string('mobile');
        $table->string('mail');
        $table->binary('image') ; //image that i wanna use 
        $table->mediumText('Discription');
        $table->timestamps();
    });
}

this approach was not worked view shows like this how can i solve this problem,suggest the new approaches better than that, i can't use public/storage folder because of all the images should be saved in database



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire