本文整理汇总了PHP中app\Project::load方法的典型用法代码示例。如果您正苦于以下问题:PHP Project::load方法的具体用法?PHP Project::load怎么用?PHP Project::load使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类app\Project
的用法示例。
在下文中一共展示了Project::load方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: index
/**
* Display a listing of project team.
*
* @return Response
*/
public function index(Project $project)
{
$project->load('team');
return response()->json($project);
}
示例2: backlogs
/**
* Shows backlogs associated with the given project
*
* @param Project $project
* @return Response
*/
public function backlogs(Project $project)
{
$project->load('backlogs');
$developers = User::where('role', 'developer')->lists('name', 'id');
return view('projects.backlogs', compact('project', 'developers'));
}
示例3: show
/**
* Display the specified resource.
*
* @param Project $project
* @return Response
*/
public function show(Project $project)
{
$project->load('labels', 'team', 'activity');
return response()->json($project);
}
示例4: edit
/**
* Show the edit form, for a saved project.
*
* @param Project $project
* @throws UserRequiresAuthenticationException
* @throws UserNotOwnerOfProjectException
* @throws ProjectCompletedException
* @return \Illuminate\View\View
*/
public function edit(Project $project)
{
if (is_null(Auth::user())) {
throw new UserRequiresAuthenticationException(trans('create-project-form.not-authenticated'));
}
if ($project->user_id != Auth::user()->id) {
throw new UserNotOwnerOfProjectException(trans('create-project-form.not-owner'));
}
if ($project->application_status == 1) {
throw new ProjectCompletedException(trans('create-project-form.project-complete'));
}
$project->load(['documents', 'mainImage', 'secondaryImages']);
$user = Auth::user();
return view('create-project.edit', compact('project', 'user'));
}