Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/php/233.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
Php 为什么公布的会议没有出现?_Php_Laravel - Fatal编程技术网

Php 为什么公布的会议没有出现?

Php 为什么公布的会议没有出现?,php,laravel,Php,Laravel,我有以下查询以获取已发布的会议: $publishedConferences = $user->conferences()-> where(function ($query) { $query->where('status', '=', 'P'); $query->where('end_date','>', now()); })

我有以下查询以获取已发布的会议:

$publishedConferences =
            $user->conferences()->
            where(function ($query) {
                $query->where('status', '=', 'P');
                $query->where('end_date','>', now());
            })
                ->paginate($pageLimit);

        dd($publishedConferences);
但是$publishedConferences显示:

LengthAwarePaginator {#345 ▼
  #total: 1
  #lastPage: 1
  #items: Collection {#344 ▶}
  #perPage: 5
  #currentPage: 2
  #path: "https://proj.test/user/profile"
  #query: []
  #fragment: null
  #pageName: "page"
}
因此没有会议出现。然而,在数据库中,有一个会议的状态为“P”,而“结束日期”为“>now()”

你知道会有什么问题吗

显示已发布会议的HTML:

<div class="tab-pane fade show clearfix" id="publishedConferences" role="tabpanel"
 aria-labelledby="home-tab">
    <ul class="list-group">
        @foreach($publishedConferences as $publishedConference)
            @if(!empty($publishedConference))
                <li class="list-group-item">
                    <p>{{$publishedConference->start_date->formatLocalized('%a, %b %d, %Y - %H:%M')}}</p>
                    <h5>{{$publishedConference->name}}</h5>
                </li>
            @endif
        @endforeach
    </ul>

    <div class="text-center d-flex justify-content-center mt-3">
        {{$publishedConferences->fragment('publishedConferences')->links("pagination::bootstrap-4")}}

    </div>
</div>

    @foreach($publishedConference作为$publishedConference) @如果(!empty($publishedConference))
  • {{$publishedConference->start_date->formatLocalized(“%a,%b%d,%Y-%H:%M”)}

    {{$publishedConference->name}
  • @恩迪夫 @endforeach
{{$publishedConferences->fragment('publishedConferences')->链接(“分页::引导-4”)}
将where子句更改为:

 // or toDateTimeString() if needed for datetime type column
 $query->where('end_date','>', now()->toDateString());