本文整理匯總了PHP中Review::with方法的典型用法代碼示例。如果您正苦於以下問題:PHP Review::with方法的具體用法?PHP Review::with怎麽用?PHP Review::with使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Review
的用法示例。
在下文中一共展示了Review::with方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: show
/**
* Display the specified resource.
*
* @param int $id
* @return Response
*/
public function show($id)
{
//$id=job_id;
$jobs = Job::with('creator')->get();
$review = Review::with('job')->findorFail($id);
$data = array('jobs' => $jobs, 'review' => $review);
return View::make('temp_reviews.show')->with($data);
}
示例2: show
public function show(User $user, Application $app)
{
if (\Auth::check()) {
$url = str_contains($this->checkloginpage($user->name), \Auth::user()->name);
} else {
$url = false;
}
$review = Review::with('users')->where('application_id', '=', $app->id)->get();
return view('userApp.showUserApp', compact('app', 'review', 'user', 'url'));
}
示例3: show
/**
* Display the specified resource.
*
* @param int $id
* @return Response
*/
public function show($id)
{
$user = User::findOrFail($id);
$jobIds = array();
foreach ($user->appliedJobs as $job) {
$jobIds[] = $job->id;
}
if (count($jobIds) > 0) {
$reviews = Review::with('job')->whereIn('job_id', $jobIds)->orderBy('created_at', 'desc')->paginate(4);
} else {
$reviews = [];
}
$data = array('user' => $user, 'reviews' => $reviews);
return View::make('users.view_profile')->with($data);
}