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


PHP Event::all方法代码示例

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


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

示例1: run

 /**
  * Run the database seeds.
  *
  * @return void
  */
 public function run()
 {
     $room = new Room();
     $room->event_id = Event::all()->first()->id;
     $room->length = 200;
     $room->width = 400;
     //need 25 tables of 6 people
     $room->save();
 }
开发者ID:rob-meh,项目名称:table-seater,代码行数:14,代码来源:RoomSeeder.php

示例2: run

 /**
  * Run the database seeds.
  *
  * @return void
  */
 public function run()
 {
     foreach (Conference::all() as $conference) {
         $conference->managers()->attach(1);
     }
     foreach (Event::all() as $event) {
         $event->managers()->attach(1);
     }
 }
开发者ID:vinlore,项目名称:huddle,代码行数:14,代码来源:ManagersSeeder.php

示例3: index

 /**
  * Display a listing of the resource.
  *
  * @return Response
  */
 public function index()
 {
     //
     $events = Event::all();
     $response = new \stdClass();
     $response->success = true;
     $response->total = count($events);
     $response->data = $events;
     return response()->json($response);
 }
开发者ID:HenOltma,项目名称:EventMap,代码行数:15,代码来源:EventRESTController.php

示例4: index

 /**
  * Display a listing of the resource.
  *
  * @return Response
  */
 public function index()
 {
     $events = Event::all();
     $event_arr = array();
     foreach ($events as $key => $value) {
         $item = array('id' => $value->id, 'title' => $value->title, 'start' => $value->start, 'end' => $value->end);
         array_push($event_arr, $item);
     }
     $event_json = json_encode($event_arr);
     return view('events.calendars', compact('event_json'));
 }
开发者ID:phanngoc,项目名称:internal-tool,代码行数:16,代码来源:EventController.php

示例5: showSales

 /**
  * Display the specified resource.
  *
  * @return \Illuminate\Http\Response
  */
 public function showSales()
 {
     $events = Event::all();
     $tickets = Ticket::all();
     $eventInformation = [];
     foreach ($events as $event) {
         // pueden ser muchos eventos. Necesito información para llenar la tabla
         $eventsDate = Presentation::where('event_id', '=', $event->id)->where('cancelled', '=', 0)->get();
         foreach ($eventsDate as $eventDate) {
             $tickets = Ticket::where('presentation_id', '=', $eventDate->id)->get();
             $onlineTickets = 0;
             $presentialTicket = 0;
             $subTotalOnline = 0;
             $subTotalPresential = 0;
             foreach ($tickets as $ticket) {
                 if ($ticket->cancelled != 1) {
                     if (empty($ticket->salesman_id)) {
                         $onlineTickets = $onlineTickets + $ticket->quantity;
                         $subTotalPresential = $subTotalPresential + $ticket->total_price;
                     } else {
                         $presentialTicket = $presentialTicket + $ticket->quantity;
                         $subTotalOnline = $subTotalOnline + $ticket->total_price;
                     }
                 }
             }
             array_push($eventInformation, array($event->name, $eventDate->id, date("d/m/Y", $eventDate->starts_at), $onlineTickets, $subTotalPresential, $presentialTicket, $subTotalOnline, $subTotalPresential + $subTotalOnline));
         }
     }
     //
     //return $eventInformation;
     return view('internal.admin.reports.sales', compact('eventInformation'));
 }
开发者ID:TAMQuiroz,项目名称:starkTicket,代码行数:37,代码来源:ReportController.php

示例6: createEvents

<?php

/**
 * Created by PhpStorm.
 * User: criativa
 * Date: 24/09/15
 * Time: 13:50
 */
require_once 'vendor/autoload.php';
require_once 'config/database.php';
use App\Models\Event;
require_once 'migrate.php';
$events = [["dia" => "24/10", "horario" => "9:00 ~ 12:00", "vagas" => 300], ["dia" => "24/10", "horario" => "14:00 ~ 17:00", "vagas" => 300], ["dia" => "25/10", "horario" => "9:00 ~ 12:00", "vagas" => 300], ["dia" => "25/10", "horario" => "14:00 ~ 17:00", "vagas" => 300]];
if (Event::all()->count() < count($events)) {
    createEvents($events);
}
function createEvents($events)
{
    foreach ($events as $event) {
        Event::create($event);
    }
}
开发者ID:bsampaio,项目名称:Criobanco,代码行数:22,代码来源:start.php

示例7: generateCalendar

 public function generateCalendar(Request $request)
 {
     $vCalendar = new Calendar('www.boilermake.org');
     $events = Event::all();
     // Iterate through all events
     foreach ($events as $event) {
         $vEvent = new \Eluceo\iCal\Component\Event();
         $vEvent->setDtStart(new \DateTime($event->begin))->setDtEnd(new \DateTime($event->end))->setNoTime(true)->setSummary($event->title);
         $vCalendar->addComponent($vEvent);
     }
     // Headers that might not actually do anything
     header('Expires: Sat, 26 Jul 1997 05:00:00 GMT');
     //date in the past
     header('Last-Modified: ' . gmdate('D, d M Y H:i:s') . ' GMT');
     //tell it we just updated
     header('Cache-Control: no-store, no-cache, must-revalidate');
     //force revaidation
     header('Cache-Control: post-check=0, pre-check=0', false);
     header('Pragma: no-cache');
     header('Content-Type: text/calendar; charset=utf-8');
     header('Content-Disposition: attachment; filename="cal.ics"');
     echo $vCalendar->render();
 }
开发者ID:BoilerMake,项目名称:backend,代码行数:23,代码来源:ExecController.php

示例8: index

 public function index()
 {
     $events = Event::all();
     return $events;
 }
开发者ID:aindong,项目名称:cmnterprise-front,代码行数:5,代码来源:EventsController.php

示例9: json_encode

<?php

/* 
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
require_once 'vendor/autoload.php';
require_once 'config/database.php';
use App\Models\Event;
header("Access-Control-Allow-Origin: *");
echo json_encode(Event::all()->toArray());
开发者ID:bsampaio,项目名称:Criobanco,代码行数:12,代码来源:list-events.php


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