本文整理汇总了PHP中app\Event::update方法的典型用法代码示例。如果您正苦于以下问题:PHP Event::update方法的具体用法?PHP Event::update怎么用?PHP Event::update使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类app\Event
的用法示例。
在下文中一共展示了Event::update方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: update
/**
* Update the specified resource in storage.
*
* @param \Illuminate\Http\Request $request
* @param int $id
* @return \Illuminate\Http\Response
*/
public function update(Request $request, Studio $studio, Event $event)
{
$event->update($this->prepare($request, $studio));
$event->pieces()->sync($this->prepareTags($request, 'piece_list'));
$event->categories()->sync($this->prepareTags($request, 'category_list'));
return redirect()->action('Admin\\StudioEventsController@show', [$studio->id, $event->id]);
}
示例2: update
/**
* Update the specified resource in storage.
*
* @param App\Http\Requests\CreateEventRequest
* @param \App\Event
* @return \Illuminate\Http\Response
*/
public function update(CreateEventRequest $request, Event $event)
{
if ($request->ajax()) {
$title = $request->input('title');
$location = $request->input('location');
$date = $request->input('date');
$date = $date === null ? null : new Carbon($date);
$event->update(compact('title', 'date', 'location'));
return;
}
return redirect(action('EventsController@index'));
}
示例3: update
/**
* Update the specified resource in storage.
*
* @param Event $event
* @param EventRequest $request
* @return Response
*/
public function update(Event $event, EventRequest $request)
{
$event->update($request->all());
\Session::flash('flash_message_event_updated', 'Tu evento ha sido actualizado');
return redirect('events');
}
示例4: update
/**
* Update the specified resource in storage.
*
* @param \Illuminate\Http\Request $request
* @param int $id
* @return Response
*/
public function update(Requests\CreateEventRequest $request, Event $event)
{
$input = $request->all();
$input['ep'] = $this->_calculateEffortPoints($input);
$currentMemberIds = $event->getMemberIdsAsArray();
foreach ($currentMemberIds as $currentMemberId) {
if (!in_array($currentMemberId, $input['members'])) {
$event->members()->detach($currentMemberId);
}
}
if (is_array($input['members'])) {
foreach ($input['members'] as $memberId) {
if (!in_array($memberId, $currentMemberIds)) {
$event->members()->attach($memberId);
}
}
}
$event->update($input);
return redirect('events');
}
示例5: update
/**
* Update the specified resource in storage.
*
* @param \Illuminate\Http\Request $request
* @param int $id
* @return \Illuminate\Http\Response
*/
public function update(Request $request, Event $event)
{
$event->update($request->input());
$event->calendars()->sync($request->input()['calendars']);
return redirect()->action('EventsController@index');
}
示例6: update_Paperwork
/**
* Update the status of some paperwork.
* @param \App\Http\Requests\GenericRequest $request
* @param \App\Event $event
* @return mixed
*/
private function update_Paperwork(GenericRequest $request, Event $event)
{
// Check the event type is event
if (!$event->isEvent()) {
return $this->ajaxError('Paperwork is only applicable to events');
}
// Check the paperwork type is valid
$type = $request->get('field');
if (!isset(Event::$Paperwork[$type])) {
return $this->ajaxError('Unknown paperwork type: ' . $type);
}
// Save
$event->update(['paperwork' => array_merge($event->paperwork, [$type => $request->get('value') === 'true'])]);
return Response::json(true);
}
示例7: update
/**
* Update the specified resource in storage.
*
* @param Request $request
* @param int $id
* @return Response
*/
public function update(EventRequest $request, Studio $studio, Event $event)
{
$event->update($this->prepareEventData($request, $studio));
$this->syncPieces($event, $request->input('piece_list'));
return redirect()->route('admin.studio.events.show', [$studio->slug, $event->id])->with('message', 'Event updated');
}