本文整理匯總了PHP中models\User::streamers方法的典型用法代碼示例。如果您正苦於以下問題:PHP User::streamers方法的具體用法?PHP User::streamers怎麽用?PHP User::streamers使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類models\User
的用法示例。
在下文中一共展示了User::streamers方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: getStream
public function getStream($streamerName)
{
$user = $this->streamingUser->has($streamerName);
if ($user !== null) {
return view('stream.watcher', ['streamer' => $user]);
}
$user = null;
$user = User::streamers()->where('twitch_channel', '=', $streamerName)->get()->first();
if (count($user) > 0) {
return view('stream.offline', ['streamer' => $user]);
}
return redirect(route('streams'));
}
示例2: retrieveData
/**
* @return \Illuminate\Database\Eloquent\Collection
*/
private function retrieveData()
{
return User::streamers()->where('streaming', '=', '1')->orderBy('twitch_channel')->get()->filter(function ($streamer) {
return $this->isStreamingOnTwitch($streamer->twitch_channel);
});
}