當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。