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


PHP Event::save方法代码示例

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


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

示例1: create

 public function create(Request $req)
 {
     $event = new Event();
     $event->name = $req->input('name');
     $event->save();
     return response()->json(['id' => $event->id]);
 }
开发者ID:alexalexandresq,项目名称:ConCalendar,代码行数:7,代码来源:EventController.php

示例2: testActivityCanBeAddedToAnEvent1

 public function testActivityCanBeAddedToAnEvent1()
 {
     $this->logIn();
     $event = new Event();
     $event->name = 'Kokous';
     $event->time = '2016-07-25 16:40:00';
     $event->place = 'Kolo';
     $event->description = 'Iltakokous';
     $event->endDate = '2016-07-25 17:20:20';
     $event->group_id = self::createTestGroup();
     $event->save();
     $activity = new Activity();
     $activity->name = 'Kalastus';
     $activity->guid = 'Guid';
     $activity->age_group = 'sudenpennut';
     $activity->task_group = 'pohjoinen';
     $activity->save();
     $event_id = DB::table('events')->where('name', 'Kokous')->value('id');
     // Pitää muutta occurensejä käyttämään
     /* $this->visit('/events/'. $event_id)
        ->click('Muuta aktiviteetteja')
        ->see('Äänestys')
        ->press('Lisää')
        ->click('Takaisin')
        ->see('Äänestys'); */
 }
开发者ID:partio-scout,项目名称:kokous_backend,代码行数:26,代码来源:ActivityViewTest.php

示例3: store

 /**
  * Store a newly created resource in storage.
  *
  * @param  \Illuminate\Http\Request  $request
  * @return \Illuminate\Http\Response
  */
 public function store(Requests\CreateEventRequest $request)
 {
     $input = Request::all();
     $event = new Event();
     $event->name = $input['name'];
     $event->save();
     return redirect()->action('EventsController@index');
 }
开发者ID:jacqhernandez,项目名称:lsopcs,代码行数:14,代码来源:EventsController.php

示例4: store

 /**
  * Store a newly created resource in storage.
  *
  * @return Response
  */
 public function store(CrearEventRequest $request)
 {
     //dd('hola')
     //echo json_encode($request);
     $event = new Event($request->all());
     $event->save();
     //return redirect('perfil/'.$request->user_id.'/camp/'.$request->camp_id.'/cultiu/'.$event->cultiu_id);
 }
开发者ID:vi1004t,项目名称:pfg,代码行数:13,代码来源:EventController.php

示例5: store

 /**
  * Store a newly created resource in storage.
  *
  * @param Request $request
  * @return Response
  */
 public function store(Request $request)
 {
     $event = new Event();
     /**
      * [...]
      */
     $event->save();
     return redirect()->route('events.index')->with('message', 'Item created successfully.');
 }
开发者ID:jbenner-radham,项目名称:v-phoenix,代码行数:15,代码来源:EventController.php

示例6: store

 public function store()
 {
     $seven_days = 60 * 60 * 24 * 7;
     $two_hours = 60 * 60 * 2;
     $season = $_REQUEST['season'];
     $venue_id = $_REQUEST['venue_id'];
     $activity = $_REQUEST['activity'];
     $lastSeasonsLeague = League::where('season', $season - 1)->where('venue_id', $venue_id)->where('activity', $activity)->first();
     $lastSeasonsLastGame = Event::where('league_id', $lastSeasonsLeague->id)->where('week_num', 'Wild Card')->where('game_num', 1)->first();
     $start_dt = $_REQUEST['start_dt'];
     $start_dt = $start_dt ? strtotime($start_dt) : strtotime($lastSeasonsLastGame->date) + $seven_days;
     $start_wk = $_REQUEST['start_wk'];
     $start_wk -= 1;
     $week_cnt = $_REQUEST['week_cnt'];
     $game_cnt = $_REQUEST['game_cnt'];
     $games_tm = $_REQUEST['games_tm'];
     $games_tm = $games_tm ? strtotime($games_tm) : strtotime($lastSeasonsLastGame->time);
     $events = [];
     for ($i = $start_wk; $i <= $week_cnt; $i++) {
         $week_num = $i == $week_cnt ? 'Wild Card' : $i + 1;
         for ($j = 0; $j < $game_cnt; $j++) {
             $datetime = date('Y-m-d', $start_dt + $seven_days * $i) . ' ' . date('H:i:s', $games_tm + $two_hours * $j);
             $game_num = $j + 1;
             $league = League::where('season', $season)->where('venue_id', $venue_id)->where('activity', $activity)->first();
             if (!$league) {
                 $league = new League();
                 $league->season = $season;
                 $league->venue_id = $venue_id;
                 $league->activity = $activity;
                 $league->save();
             }
             $event = new Event();
             $event->league_id = $league->id;
             $event->season = $league->season;
             $event->venue_id = $league->venue_id;
             $event->datetime = $datetime;
             $event->week_num = $week_num;
             $event->game_num = $game_num;
             $event->activity = $league->activity;
             $events[] = $event;
         }
     }
     try {
         DB::transaction(function () use($events) {
             foreach ($events as $event) {
                 $event->save();
             }
         });
         $_SESSION['ALERT'] = alert('Season Added!', "Season {$season} for " . Venue::find($venue_id)->name . " was created successfully.", 'success');
     } catch (Excepton $e) {
         print_r($e);
         exit;
         $_SESSION['ALERT'] = alert('Season Not Added!', "Season {$season} for " . Venue::find($venue_id)->name . " could not be created.", 'error');
     }
     return redirect('/seasons');
 }
开发者ID:MadeByGlutard,项目名称:GreenMountainGaming.com,代码行数:56,代码来源:SeasonsController.php

示例7: store

 /**
  * Store a newly created resource in storage.
  *
  * @return Response
  */
 public function store(Request $request)
 {
     $event = new Event();
     $event->when = new \DateTime($request->input('when'));
     $event->user_id = \Auth::user()->id;
     if ($event->save()) {
         return \Redirect::to('/home')->withMessage(['type' => 'success', 'body' => 'Evento cadastrado com sucesso!']);
     }
     return \Redirect::back()->withMessage(['type' => 'error', 'body' => 'Não foi possivel cadastrar as informações do seu evento'])->withInput();
 }
开发者ID:jaschweder,项目名称:tcc,代码行数:15,代码来源:EventController.php

示例8: store

 /**
  * Store a newly created resource in storage.
  *
  * @param  \Illuminate\Http\Request  $request
  * @return \Illuminate\Http\Response
  */
 public function store(Request $request)
 {
     $event = new Event();
     $event->name = $request->input('name');
     $event->start_date = $request->input('start_date');
     $event->end_date = $request->input('end_date');
     $event->notes = $request->input('notes');
     $event->save();
     return response()->json(['newId' => $event->id]);
 }
开发者ID:breenyoung,项目名称:wfadmin,代码行数:16,代码来源:EventController.php

示例9: newEvent

 public function newEvent($user)
 {
     $event = new Event();
     $event->user_id = $user->id;
     $event->event_icon = Input::get('icon');
     $event->event_title = Input::get('title');
     $event->event_description = Input::get('description');
     $event->event_date = Input::get('date');
     $event->event_color = Input::get('color');
     $event->save();
 }
开发者ID:mathewsandi,项目名称:Practice,代码行数:11,代码来源:CalendarRepository.php

示例10: postCreate

 /**
  * Show the form for creating a new resource.
  *
  * @return Response
  */
 public function postCreate(Request $request)
 {
     //
     $date = Carbon::parse($request->input('event_date'))->toDateTimeString();
     $event = new Event();
     $event->event_name = $request->input('event_name');
     $event->event_date = $date;
     $event->event_place = $request->input('event_place');
     $event->event_description = $request->input('event_description');
     $event->save();
     return redirect('/admin/event');
 }
开发者ID:palhimanshu1991,项目名称:dastangoi,代码行数:17,代码来源:EventController.php

示例11: store

 /**
  * Store a newly created resource in storage.
  *
  * @param  \Illuminate\Http\Request  $request
  * @return \Illuminate\Http\Response
  */
 public function store(Request $request)
 {
     $this->validate($request, ['name' => 'required|min:5|max:15', 'title' => 'required|min:5|max:100', 'time' => 'required|available|duration']);
     $time = explode(" - ", $request->input('time'));
     $event = new Event();
     $event->name = $request->input('name');
     $event->title = $request->input('title');
     $event->start_time = $this->change_date_format($time[0]);
     $event->end_time = $this->change_date_format($time[1]);
     $event->save();
     $request->session()->flash('success', 'The event was successfully saved!');
     return redirect('events/create');
 }
开发者ID:pisyek,项目名称:room-booking-system,代码行数:19,代码来源:EventController.php

示例12: store

 /**
  * Store a newly created resource in storage.
  *
  * @param  Request  $request
  * @return Response
  */
 public function store(Request $request)
 {
     $event = new Event();
     $event->event_name = $request->event_name;
     $event->event_desc = $request->event_desc;
     $event->event_owner = Auth::user()->id;
     $event->event_loca = $request->event_loca;
     $event->event_type = $request->event_type;
     $event->event_priv = $request->event_priv;
     $event->save();
     //echo $request->nomevent;//esto ya me da el id que necesito para hacer una fk
     return redirect('/event')->with('message', 'Se agrego un nuevo event correctamente');
 }
开发者ID:jona872,项目名称:planear5,代码行数:19,代码来源:EventController.php

示例13: store

 /**
  * Store a newly created resource in storage.
  *
  * @param  Request  $request
  * @return Response
  */
 public function store(CreateEventRequest $request)
 {
     $event = new Event();
     //  $date = date('d-m-Y',Input::get('date'));
     //   dd($date);
     // $date='2015-05-02 12:00:00';
     //$date = Carbon::CreateFromFormat('dd-mm-yyyy', Input::get('date'));
     //dd($date);
     //$usableDate = $date->format('Y-m-d H:i:s');
     $event->date = $date;
     $event->name = Input::get('name');
     $event->user_id = Auth::id();
     $event->save();
     dd($event);
 }
开发者ID:simonigd,项目名称:seating,代码行数:21,代码来源:EventsController.php

示例14: postEvent

 public function postEvent(EventRequest $request)
 {
     $data = Input::get();
     for ($i = 0; $i < count($data['eventname']); $i++) {
         $c = new Event();
         $c->event = $data['eventname'][$i];
         $c->eventcode = $data['eventcode'][$i];
         $c->date = $data['date'][$i];
         $c->city = $data['city'][$i];
         $c->country = $data['country'][$i];
         $c->save();
     }
     $request->session()->flash('alert-success', 'Event was successful added!');
     return redirect('executor/home');
 }
开发者ID:harshithanaiduk,项目名称:iclock-newtheme,代码行数:15,代码来源:ExecutorController.php

示例15: run

 /**
  * Run the database seeds.
  *
  * @return void
  */
 public function run()
 {
     $event = new Event();
     $event->description = 'Crack and solve puzzles to find the answer.';
     $event->end_date = Carbon::now()->toIso8601String();
     $event->featured = true;
     $event->image = 'heist.png';
     $event->group_id = 1;
     $event->location = 'GOL-1670';
     $event->name = 'The Heist';
     $event->short_description = 'Crack and solve puzzles to find the answer.';
     $event->short_name = 'Heist';
     $event->start_date = Carbon::now()->toIso8601String();
     $event->save();
 }
开发者ID:kocsenc,项目名称:api,代码行数:20,代码来源:EventTableSeeder.php


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