本文整理汇总了PHP中app\Project::tasks方法的典型用法代码示例。如果您正苦于以下问题:PHP Project::tasks方法的具体用法?PHP Project::tasks怎么用?PHP Project::tasks使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类app\Project
的用法示例。
在下文中一共展示了Project::tasks方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: store
/**
* Store a newly created task.
*
* @param Request $request
* @param Project $project
* @return Task
*/
public function store(Request $request, Project $project)
{
$task = new Task($request->all());
if (!empty($user_id = $request->input('user_id'))) {
$user = \App\User::findOrFail($user_id);
$task->assignee()->associate($user);
}
$project->tasks()->save($task);
return $task;
}
示例2: store
/**
* Store a newly created resource in storage.
*
* @param App\Client $client
* @param App\Project $project
* @param \Illuminate\Http\Requests\ProjectRequest $request
* @return \Illuminate\Http\Response
*/
public function store(Client $client, Project $project, ProjectTaskRequest $request)
{
$task = $project->tasks()->create($request->all());
flash()->overlay('Task created for ' . $task->owner->name, $task->title . ' has been created.', 'success');
return redirect()->route('projects.show', [$client, $project]);
}
示例3: store
/**
* Creación de una tarea
*
* @param TaskRequest $request
* @param Project $project
* @return \Illuminate\Http\RedirectResponse
*/
public function store(TaskRequest $request, Project $project)
{
$inputs = $request->only(['name', 'description', 'responsible_id']);
$task = $project->tasks()->create($inputs);
Flash::success('Se ha creado una nueva tarea');
event(new TaskWasAssigned($task, $this->user));
Log::info("Tarea Creada", ['task' => $task->name, 'responsible' => $task->responsible->name]);
return redirect()->route('Projects::show_path', [$project->id]);
}