本文整理汇总了PHP中Carbon::createFromTime方法的典型用法代码示例。如果您正苦于以下问题:PHP Carbon::createFromTime方法的具体用法?PHP Carbon::createFromTime怎么用?PHP Carbon::createFromTime使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Carbon
的用法示例。
在下文中一共展示了Carbon::createFromTime方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: processEditCongregation
/**
* Process a form to edit an existing congregation.
*
* @param integer $id The id of the congregation to edit.
*
* @return mixed The response.
*/
public function processEditCongregation($id)
{
try {
// Get inputs.
$congregation = new Congregation();
$congregation->name = Input::get('name');
$congregation->address = Input::get('address');
$congregation->pm_day_of_week = Input::get('pm_day_of_week');
$pmHours = Input::get('pm_datetime_hours');
$pmMinutes = Input::get('pm_datetime_minutes');
$congregation->pm_datetime = Carbon::createFromTime($pmHours, $pmMinutes, 0);
// Update congregation.
CongregationService::updateCongregation($id, $congregation);
$this->success(trans('messages.congregationUpdated'));
return Redirect::route('congregations.list');
} catch (ValidationException $e) {
return Redirect::route('congregations.edit')->withInput(Input::all())->withErrors($e->getValidator());
} catch (Exception $e) {
return $this->unexpected($e);
}
}