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


PHP Evento::Find方法代码示例

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


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

示例1: store

 /**
  * Store a newly created resource in storage.
  * POST /participant
  *
  * @return Response
  */
 public function store($id)
 {
     $user = Auth::user();
     $club = $user->Clubs()->FirstOrFail();
     $event = Evento::Find($id);
     $player = Player::Find(Input::get('player'));
     $uuid = Uuid::generate();
     $input = Input::all();
     $messages = array('player.required' => 'Please select at least one player');
     $validator = Validator::make(Input::all(), Participant::$rules, $messages);
     $validator->sometimes(array('fee', 'early_fee', 'early_deadline'), 'required', function ($input) {
         return $input->fee != '';
     });
     $validator->sometimes(array('fee', 'early_fee', 'early_deadline'), 'required', function ($input) {
         return $input->early_fee != '';
     });
     $validator->sometimes(array('fee', 'early_fee', 'early_deadline'), 'required', function ($input) {
         return $input->early_deadline != '';
     });
     $validator->sometimes(array('fee', 'early_fee', 'early_deadline'), 'required', function ($input) {
         return $input->plan_id != '';
     });
     if (empty(Input::get('fee'))) {
         $fee = $event->getOriginal('fee');
     } else {
         $fee = Input::get('fee');
     }
     if (empty(Input::get('early_fee'))) {
         $early_fee = $event->getOriginal('early_fee');
     } else {
         $early_fee = Input::get('early_fee');
     }
     if (empty(Input::get('early_deadline'))) {
         $early_deadline = $event->early_due_deadline;
     } else {
         $early_deadline = Input::get('early_deadline');
     }
     if (empty(Input::get('plan_id'))) {
         $plan_id = $event->plan_id;
     } else {
         $plan_id = Input::get('plan_id');
     }
     if (Input::get('fee') == '0') {
         $fee = 0;
         $plan_id = null;
     }
     if (Input::get('fee') > 0) {
         $plan_id = Input::get('plan_id');
     }
     if ($validator->passes()) {
         $participant = new Participant();
         $participant->id = $uuid;
         $participant->firstname = $player->firstname;
         $participant->lastname = $player->lastname;
         $participant->due = $fee;
         $participant->early_due = $early_fee;
         $participant->early_due_deadline = $early_deadline;
         $participant->plan_id = $plan_id;
         $participant->player_id = $player->id;
         $participant->event_id = $event->id;
         $status = $participant->save();
         if ($status) {
             $participant = Participant::find($uuid);
             //send email notification of acceptance
             $data = array('club' => $club, 'player' => $player, 'user' => $user, 'participant' => $participant);
             $mail = Mail::send('emails.notification.event.invite', $data, function ($message) use($user, $club, $participant) {
                 $message->from('C2C@leaguetogether.com', 'C2C Lacrosse')->to($participant->player->user->email, $participant->accepted_by)->subject("You're Invited to join our event | " . $club->name);
             });
             return Redirect::action('EventoController@show', $event->id)->with('notice', 'Player added successfully');
         } else {
             $error = $status->errors()->all(':message');
             return Redirect::back()->withInput()->withErrors($error);
         }
     }
     $error = $validator->errors()->all(':message');
     return Redirect::back()->withInput()->withErrors($error);
 }
开发者ID:illuminate3,项目名称:league-production,代码行数:83,代码来源:ParticipantController.php

示例2: PaymentRemoveCartItem

 public function PaymentRemoveCartItem($club, $id)
 {
     $club = Club::Find($club);
     $event = Evento::Find($id);
     // Clean the cart
     Cart::destroy();
     return Redirect::action('ClubPublicController@selectPlayer', array($club->id, $event->id));
 }
开发者ID:illuminate3,项目名称:league-production,代码行数:8,代码来源:ClubPublicController.php


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