How to show variable in view blade.php page using laravel paginator::make

233 views Asked by At
Route::get('all-list', function()
{
    $page = Input::get('page', 1);
    $paginate = 5;

    $recipes = DB::table("advertisements")->select("ad_id", "ad_title", "user_id", "ad_desc", "created_at")
            ->where("ad_status", "=", 1);

    $items = DB::table("sellers")->select("seller_id", "seller_name", "user_id", "seller_desc", "created_at")
            ->where("seller_status", "=", 1)
            ->union($recipes)
            ->get();

    $slice = array_slice($items, $paginate * ($page - 1), $paginate);
    $result = Paginator::make($slice, count($items), $paginate);

    return View::make('pages.search-listing-all',compact('result'));
});

I Can view pagination page 1 2 3 4 only shown wihtout error in view page using this code {{ $result->appends(Input::except('page'))->links(); }} but i cant show the seller or advertisement value ..

@foreach ($result  as $data => $value)

     {{ $value->ad_title }}

@endforeach

error shown:

Undefined property: stdClass::$ad_title

0

There are 0 answers