Tuesday, March 7, 2017

Undefined property: Sleimanx2\Plastic\PlasticPaginator::$photo_url (View)

How would I correctly perform a foreach into received data array?

My query currently is like : ErrorException in 0acef40c7c8195edb15b2c11970f0a8617dad5e4.php line 9: Undefined property: Sleimanx2\Plastic\PlasticPaginator::$photo_url (View: C:\xampp\htdocs\elasticsearch\resources\views\presult.blade.php) (View: C:\xampp\htdocs\elasticsearch\resources\views\presult.blade.php)

 public function pricefilter(Request $request)
    {
         $query = Input::get('query', false);
         $brans = request()->priceFilter;
          $books = new Collection();
        if(!empty($brans))
        {

                foreach($brans as $data)
                {
                   $minMax = explode("-",$data);
                   if(count($minMax)==2){
                    $product[] = Afica::search()
                        ->multiMatch(['name','city_hotel'], $query, ['fuzziness' => 'AUTO'])
                        ->filter()
                        ->range('minrate',['from'=>$minMax[0],'to'=>$minMax[1]])
                        ->paginate(26);
                }

                 }
                 $books = $product;

         }
        else 
        {
            $books = Afica::search()
            ->paginate(26);
        }
        if ($request->ajax())
        {
                return view('presult', compact('books'));
        }
        return view('welcome',compact('books'))->render(); 

     }

And In the view : I use foreach

@foreach($books as $Afica)

        <article class="one-third">
          <figure><a href="#" title=""><img src="}" alt="" style="height: 215px!important;" /></a></figure>

          <div class="details">

            <h3>}
              <span class="stars">

                  <?php 

                  for ($i=1 ; $i<=$Afica->class ; $i++) 
                  {
                  echo ' <i class="material-icons">&#xE838;</i>';
                  }

              ?>
              </span>
            </h3>
            <span class="address">},}  <a href="">Show on map</a></span>
            <span class="rating">}</span>
            <span class="price">Max rate  <em>$ }</em> </span>
            <span class="pricee">Min rate  <em>$ }</em> </span>
            <div class="description">
              <p>}<a href="hotel?query=}">More info</a></p>
            </div>   
            <a href="}" title="Book now" class="gradient-button">Book now</a>
          </div>
        </article><?php $myArray[] = $Afica->id;?>

        <!--//deal-->
        @endforeach



via koora et film Tv

Advertisement