當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Event::take方法代碼示例

本文整理匯總了PHP中app\Event::take方法的典型用法代碼示例。如果您正苦於以下問題:PHP Event::take方法的具體用法?PHP Event::take怎麽用?PHP Event::take使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在app\Event的用法示例。


在下文中一共展示了Event::take方法的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: index

 /**
  * Show the application welcome screen to the user.
  *
  * @return Response
  */
 public function index()
 {
     $events = Event::take('4')->get();
     $authors = Author::take('4')->get();
     $coverage = DB::table('press')->take('4')->orderBy('press_date', 'desc')->get();
     return view('welcome', compact('events', 'authors', 'coverage'));
 }
開發者ID:palhimanshu1991,項目名稱:dastangoi,代碼行數:12,代碼來源:WelcomeController.php

示例2: index

 /**
  * Show the application dashboard.
  *
  * @return Response
  */
 public function index()
 {
     try {
         $isInstalled = Setting::where('name', 'is_installed')->firstOrFail();
     } catch (ModelNotFoundException $e) {
         $isInstalled = Setting::create(['name' => 'is_installed', 'setting' => 'no']);
     }
     if ($isInstalled->setting != 'yes') {
         return Redirect::route('install');
     }
     $data = ["event" => Event::first(), "upcomingEvents" => Event::take(3)->get(), "news" => News::take(6)->get(), "media" => Media::where('processed', true)->orderBy('id', 'DESC')->take(12)->get()];
     return view('home')->with($data);
 }
開發者ID:TheJokersThief,項目名稱:Eve,代碼行數:18,代碼來源:HomeController.php

示例3: scanIsInsideParcel

 public function scanIsInsideParcel()
 {
     $this->middleware('auth');
     $pointLocation = new PointLocation();
     $events = Event::take(1000)->orderBy('dateGps', 'ASC')->get();
     foreach ($events as $key => $value) {
         $latLonEvent = $value->lat . "," . $value->lon;
         $event = $value;
         $parcels = Parcel::orderByRaw('lat - ' . $value->lat . '', 'ASC')->take(20)->get();
         foreach ($parcels as $key => $value) {
             $isPointInside = 0;
             $parcelsGps = ParcelGps::where('idparcel', $value->id)->orderBy('number', 'ASC')->get();
             $polygon = array();
             foreach ($parcelsGps as $key => $value) {
                 $latlng = "" . $value->lat . ", " . $value->long . "";
                 $idparcelEvent = $value->idparcel;
                 array_push($polygon, $latlng);
             }
             $isPointInside = $pointLocation->pointInPolygon($latLonEvent, $polygon, $event, $idparcelEvent);
             if ($isPointInside == 1) {
                 $event = Event::find($event->id);
                 $event->isSync = 1;
                 $event->isInside = 1;
                 $event->idParcelle = $idparcelEvent;
                 $event->save();
                 $eventprocessed = new ProcessedEvents();
                 $eventprocessed->idApp = $event->idApp;
                 $eventprocessed->idUser = $event->idUser;
                 $eventprocessed->name = $event->name;
                 $eventprocessed->lon = $event->lon;
                 $eventprocessed->lat = $event->lat;
                 $eventprocessed->dateGps = $event->dateGps;
                 $eventprocessed->timeDate = $event->timeDate;
                 $eventprocessed->isInside = $event->isInside;
                 $eventprocessed->idParcelle = $event->idParcelle;
                 $eventprocessed->altitude = $event->altitude;
                 $eventprocessed->isSync = $event->isSync;
                 $eventprocessed->save();
                 break;
             }
             if ($isPointInside == 0) {
                 $event = Event::find($event->id);
                 $event->isSync = 1;
                 $event->isInside = 0;
                 $event->idParcelle = 0;
                 $event->save();
             }
         }
     }
 }
開發者ID:BBerthod,項目名稱:AgreenWeb,代碼行數:50,代碼來源:EventController.php

示例4: showParcelsEvents

 public function showParcelsEvents()
 {
     $events = Event::take(100)->get();
     $users = User::all();
     $parcels = Parcel::all();
     $parcelsGpsArray = [];
     foreach ($parcels as $key => $value) {
         $parcelsGps = ParcelGps::where('idparcel', $value->id)->orderBy('number')->select('lat', 'long')->get();
         array_push($parcelsGpsArray, $parcelsGps);
     }
     // load the view and pass the parcels
     return View::make('app.parcel.showevent')->with('parcels', $parcelsGpsArray)->with('events', $events)->with('users', $users);
 }
開發者ID:BBerthod,項目名稱:AgreenWeb,代碼行數:13,代碼來源:ParcelController.php

示例5: getListEvents

 public function getListEvents()
 {
     $events = Event::take(2);
     return $events;
 }
開發者ID:aflashyrhetoric,項目名稱:pray,代碼行數:5,代碼來源:ListEvents.php


注:本文中的app\Event::take方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。