当前位置: 首页>>代码示例>>PHP>>正文


PHP Events::findOrFail方法代码示例

本文整理汇总了PHP中Events::findOrFail方法的典型用法代码示例。如果您正苦于以下问题:PHP Events::findOrFail方法的具体用法?PHP Events::findOrFail怎么用?PHP Events::findOrFail使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Events的用法示例。


在下文中一共展示了Events::findOrFail方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: show

 public function show($id)
 {
     $events = Events::findOrFail($id);
     $data['room'] = Rooms::select('roomtype.RoomType_Name', 'roomtype.ID_RoomType', 'roomtype_pic.Picture')->join('roomtype_pic', 'roomtype.ID_RoomType', '=', 'roomtype_pic.ID_RoomType')->where('roomtype_pic.Main_Pic', '=', 'YES')->where('roomtype.Status', '=', 'Active')->take(40)->get()->all();
     $data['offer'] = Offer::where('Status', '=', 'Active')->take(40)->get()->all();
     $data['about'] = About::get()->all();
     return View::make('Events.show', compact('events'))->with('event_active', 'active')->with('data', $data);
 }
开发者ID:hilmysyarif,项目名称:hotel-application-laravel,代码行数:8,代码来源:EventsController.php

示例2: update

 /**
  * Update the specified event in storage.
  *
  * @param  int  $id
  * @return Response
  */
 public function update($id)
 {
     $event = Events::findOrFail($id);
     $validator = Validator::make($data = Input::all(), Events::$rules);
     if ($validator->fails()) {
         return Redirect::back()->withErrors($validator)->withInput();
     }
     $event->update($data);
     return Redirect::route('events.index');
 }
开发者ID:koenhendriks,项目名称:Gora,代码行数:16,代码来源:EventsController.php

示例3: getEditEvent

 /**
  *  View for Edit Event
  *  @return View
  */
 public function getEditEvent($id)
 {
     try {
         $event = \Events::findOrFail($id);
     } catch (ModelNotFoundException $e) {
         throw new \EventNotFoundException();
     }
     $emaillist = null;
     //Get the user id of the currently logged in user
     $userId = \Sentry::getUser()->id;
     //Check Permission
     $checkpermission = $this->event->checkPermission($id, $userId);
     if ($checkpermission) {
         //Authorized, Get Event
         $event = $this->event->getEvent($id);
         foreach ($event['users'] as $user) {
             if ($emaillist == null) {
                 $emaillist = $user['email'];
             } else {
                 $emaillist = $emaillist . ',' . $user['email'];
             }
         }
         //Wrap Up and generate View
         return \View::make('dashboard.calendar.edit')->with('emaillist', $emaillist)->with('event', $event);
     } else {
         throw new \NotAuthorizedForEventException();
     }
 }
开发者ID:ymnl007,项目名称:92five,代码行数:32,代码来源:CalendarController.php

示例4: getDeleteEvent

 public function getDeleteEvent($id)
 {
     $del = Events::findOrFail($id);
     $check = File::delete('uploads/events/' . $del->img);
     $name = $del->name;
     $del->delete();
     Session::flash('message', "ลบ " . $name . " สำเร็จ!!");
     return Redirect::to('/admin/events/manage');
 }
开发者ID:pchaow,项目名称:pportal,代码行数:9,代码来源:AdminController.php


注:本文中的Events::findOrFail方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。