samedi 1 décembre 2018

Display image from storage folder in blade shared hosting laravel 5.7

When i upload images to storage folder in my localhost it's work fine but when i move my project to shared hosting he doesn't appear images i don't know why ?

Thank you for your help.

My blade look like this :

    @foreach ($data as $user)
@foreach(json_decode($user->name, true) as $images)
@endforeach
@endforeach
<!-- Wrapper for slides -->
<div class="carousel-inner">
    @foreach ($data as $user)
    @foreach(json_decode($user->name, true) as $images)
  <div class="item">

    <img src="/" alt="Los Angeles" style="width:100%;">
  </div>
  @endforeach
  @endforeach

my controller look like this :

    if($request->hasfile('image'))
 {

    foreach($request->file('image') as $image)
    {
        $name=$image->getClientOriginalName();
        $image->move(storage_path().'/slider/images/', $name);
        $data[] = $name; 
    }
  $query =  DB::table('slider')->insert([
        ['title' => 'lorem', 'alt' => 'lorem', 'name'=> json_encode($data)],
    ]);

    return "good";
 }
 else {
     return "null";
 }



from Newest questions tagged laravel-5 - Stack Overflow https://ift.tt/2U1YOgM
via IFTTT

Aucun commentaire:

Enregistrer un commentaire