Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/laravel/11.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
如何使用laravel paginator::make在view blade.php页面中显示变量_Php_Laravel_Pagination_Union - Fatal编程技术网

如何使用laravel paginator::make在view blade.php页面中显示变量

如何使用laravel paginator::make在view blade.php页面中显示变量,php,laravel,pagination,union,Php,Laravel,Pagination,Union,我可以使用此代码查看分页页面1 2 3 4,但在查看页面中显示错误{{$result->appends(Input::except('page')->links();},但我无法显示卖家或广告值 Route::get('all-list', function() { $page = Input::get('page', 1); $paginate = 5; $recipes = DB::table("advertisements")->select("ad_id"

我可以使用此代码查看分页页面1 2 3 4,但在查看页面中显示错误
{{$result->appends(Input::except('page')->links();}
,但我无法显示卖家或广告值

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'));
});
显示错误:

未定义的属性:stdClass::$ad\u title


尝试转储结果并查看返回的内容。我找到了解决方案。
returnview::make('pages.search listing all',compact('result'))->with('result',$result)
@foreach ($result  as $data => $value)

     {{ $value->ad_title }}

@endforeach