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


PHP Event::all方法代碼示例

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


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

示例1: run

    /**
     * Run the database seeds.
     *
     * @return void
     */
    public function run()
    {
        Model::unguard();
        $faker = \Faker\Factory::create();
        $user = User::create(['name' => 'Christian Kasperbauer', 'email' => 'chris.kasperbauer@gmail.com', 'password' => bcrypt('grütze'), 'phone' => '0176-23152819', 'misc' => 'Friedrich-Ebert-Ring 4
97072 Würzburg
(Ton-)Technik, KRIS, Website!', 'rights' => 'all']);
        $user2 = User::create(['name' => $faker->name, 'email' => $faker->email, 'password' => bcrypt('grütze'), 'phone' => $faker->phoneNumber, 'misc' => $faker->sentence()]);
        for ($i = 0; $i <= 15; $i++) {
            User::create(['name' => $faker->name, 'email' => $faker->email, 'password' => bcrypt('grütze'), 'phone' => $faker->phoneNumber, 'misc' => $faker->sentence()]);
        }
        Category::insert([['name' => 'Konzert', 'class' => 'light-green'], ['name' => 'Partey', 'class' => 'funky'], ['name' => 'Theater', 'class' => 'red'], ['name' => 'Kino', 'class' => 'amber'], ['name' => 'Sonstiges', 'class' => 'blue-grey'], ['name' => 'Wort', 'class' => 'light-blue']]);
        $user->events()->save(Event::create(['scheduled_at' => Carbon::now()->addDays(4), 'category_id' => rand(1, 6), 'title' => 'Basement Blast', 'subtitle' => 'Geballer im Keller', 'description' => $faker->paragraph(10), 'admission' => 'donation', 'genre' => 'Metal', 'google_event_id' => str_random(12)]));
        $user2->events()->save(Event::create(['scheduled_at' => Carbon::now()->addDays(9), 'category_id' => rand(1, 6), 'title' => 'Boxbeutel Boombox', 'subtitle' => 'Lecker Weinchen', 'description' => $faker->paragraph(10), 'admission' => 'free', 'genre' => 'Suff', 'google_event_id' => str_random(12)]));
        $user->events()->save(Event::create(['scheduled_at' => Carbon::now()->addDays(2)->addMonth(), 'category_id' => rand(1, 6), 'title' => 'Beats & Lyrics', 'subtitle' => 'Freestyle Chypher', 'description' => $faker->paragraph(10), 'admission' => 'donation', 'genre' => 'HipHop', 'google_event_id' => str_random(12)]));
        $user2->events()->save(Event::create(['scheduled_at' => Carbon::now()->subDays(2), 'category_id' => rand(1, 6), 'title' => 'Schon vorbei', 'subtitle' => 'Schade, du warst du spät', 'description' => $faker->paragraph(10), 'admission' => 'free', 'google_event_id' => str_random(12)]));
        $user->events()->save(Event::create(['scheduled_at' => Carbon::now()->subMonth(2), 'category_id' => rand(1, 6), 'title' => 'Gelöscht', 'subtitle' => 'Wird niemals stattfinden', 'description' => $faker->paragraph(10), 'admission' => 'free', 'google_event_id' => str_random(12), 'deleted_at' => Carbon::now()->subDays(7)]));
        $events = Event::all();
        foreach ($events as $event) {
            $event->options()->save(EventOptions::create(['time_start' => '19:00', 'time_end' => '00:00', 'time_meal' => '18:00', 'shifts_bar' => rand(1, 2), 'shifts_tech' => rand(0, 2), 'shifts_door' => rand(0, 1), 'meal_servings' => rand(0, 15), 'misc' => 'Test test test']));
            $user_id = rand(1, 2);
            $event->shifts()->save(Shift::create(['user_id' => $user_id, 'type' => 'tech']));
            $event->shifts()->save(Shift::create(['user_id' => $user_id == 1 ? 2 : 1, 'type' => 'bar']));
        }
        Model::reguard();
    }
開發者ID:kasperbauer,項目名稱:kris,代碼行數:31,代碼來源:DatabaseSeeder.php

示例2: getAssigntarget

 public function getAssigntarget()
 {
     $employee = Employee::all();
     $categories = Event::all();
     $userdetails = User::all();
     $targets = Targetassign::all();
     $deals = Deal::all();
     $userData = array();
     $key = 0;
     foreach ($targets as $target) {
         $achieved = 0;
         $userData[$key]['eventcode'] = $target->Eventcode;
         $userData[$key]['event'] = $target->Eventname;
         $userData[$key]['employee'] = $target->Employeeid;
         $userData[$key]['targetVal'] = $target->Targetvalue;
         foreach ($deals as $deal) {
             if ($target->Eventcode == $deal->Eventcode && $target->Employeeid == $deal->Empid) {
                 $achieved = $achieved + $deal->Dealvalue;
             }
         }
         $userData[$key]['achieved'] = $achieved;
         $userData[$key]['variance'] = $achieved - $target->Targetvalue;
         $userData[$key]['cur'] = $target->Currency;
         $key++;
     }
     return View('approval/assigntarget')->with(array('categories' => $categories, 'employee' => $employee, 'userdata' => $userData, 'targets' => $targets, 'eventtable' => $categories));
 }
開發者ID:harshithanaiduk,項目名稱:iclock-newtheme,代碼行數:27,代碼來源:ApprovalController.php

示例3: getIndex

 /**
  * Display a listing of the resource.
  *
  * @return Response
  */
 public function getIndex()
 {
     $varr = Auth::user()->empid;
     $empid = Targetassign::where('Employeeid', $varr)->get();
     $cat = Event::all();
     return View('targetmodule/eventdeal')->with(array('cat' => $cat, 'empid' => $empid));
 }
開發者ID:vikramIde,項目名稱:iclock.in,代碼行數:12,代碼來源:EventdealController.php

示例4: home

 /**
  * Display a home page.
  *
  * @return Response
  */
 public function home()
 {
     $activeUsers = 3;
     $totalUsers = User::all()->count();
     $eventCount = Event::all()->count();
     return view('admin.home', compact('activeUsers', 'totalUsers', 'eventCount'));
 }
開發者ID:charlieboo,項目名稱:creatrip,代碼行數:12,代碼來源:HomeController.php

示例5: create

 public function create()
 {
     if (!Auth::check() || !Auth::user()->is_admin) {
         return response(view('errors.403', ['error' => $this->errorMessages['incorrect_permissions']]), 403);
     }
     return view('partners.create', ['locations' => Location::all(), 'events' => Event::all()]);
 }
開發者ID:TheJokersThief,項目名稱:Eve,代碼行數:7,代碼來源:PartnersController.php

示例6: getAllEvents

 private function getAllEvents()
 {
     $now = Carbon::now();
     $thisWeek = [];
     $nextWeek = [];
     $upcoming = [];
     $past = [];
     $events = Event::all();
     foreach ($events as $event) {
         $event->banner;
         $event = $event->formatEvent();
         if ($event['start'] == null) {
             array_push($upcoming, $event);
         } else {
             if ($event->end < $now) {
                 array_push($past, $event);
             } else {
                 if ($event->start->year == $now->year && $event->start->weekOfYear == $now->weekOfYear) {
                     array_push($thisWeek, $event);
                 } else {
                     if ($event->start->weekOfYear == $now->weekOfYear + 1) {
                         array_push($nextWeek, $event);
                     }
                 }
             }
         }
     }
     $allEvents = [];
     array_push($allEvents, $thisWeek, $nextWeek, $upcoming, $past);
     return $allEvents;
 }
開發者ID:jentleyow,項目名稱:pcf,代碼行數:31,代碼來源:MainsController.php

示例7: index

 /**
  * Display a listing of the resource.
  *
  * @return \Illuminate\Http\Response
  */
 public function index()
 {
     $events = Event::all();
     if ($events === null) {
         $events = null;
     }
     return \View::make('admin.manage_slide')->withSlides($events);
 }
開發者ID:hassantariq29,項目名稱:app,代碼行數:13,代碼來源:EventManagementController.php

示例8: getData

 public function getData()
 {
     $users = User::all();
     $events = Event::all();
     $committees = Committee::all();
     $heads = Head::all();
     return view('admin/data', compact('users', 'events', 'committees', 'heads'));
 }
開發者ID:zoekayvee,項目名稱:YSESTracker,代碼行數:8,代碼來源:AdminController.php

示例9: getIndex

 public function getIndex()
 {
     $categories = Event::all();
     $employee = Employee::all();
     $invoice = Invoice::all();
     $invnull = Invoice::where('Status', '=', 'Null')->get();
     return View('home2')->with(array('categories' => $categories, 'employee' => $employee, 'invoice' => $invoice, 'invnull' => $invnull));
 }
開發者ID:vikramIde,項目名稱:iclock.in,代碼行數:8,代碼來源:ViewController.php

示例10: getIndex

 /**
  * Display a listing of the resource.
  *
  * @return Response
  */
 public function getIndex()
 {
     //
     $events = Event::all();
     $upcoming = Event::where('event_date', '>', Carbon::now())->get();
     $past = Event::where('event_date', '<', Carbon::now())->get();
     return view('event.index', compact('upcoming', 'past'));
 }
開發者ID:palhimanshu1991,項目名稱:dastangoi,代碼行數:13,代碼來源:EventController.php

示例11: home

 public function home()
 {
     $title = "Event Company TN";
     $events = Event::all();
     $services = Service::all();
     $about = DB::select('select * from about');
     $video = DB::select('select iframe from video');
     return view('index', ['title' => $title, 'about' => $about, 'services' => $services, 'events' => $events, 'video' => $video]);
 }
開發者ID:yaroslav89,項目名稱:tn-event-company,代碼行數:9,代碼來源:PagesController.php

示例12: boot

 /**
  * Bootstrap any application services.
  *
  * @return void
  */
 public function boot()
 {
     view()->composer('partials.search', function ($view) {
         $view->with('terms', Event::all());
     });
     view()->composer(['partials.nav', 'profile.show', 'dashboard.*', 'events.*', 'posts.*', 'comments.*'], function ($view) {
         $view->with('auth', Auth::user());
     });
 }
開發者ID:JolitaGrazyte,項目名稱:intoBelgium,代碼行數:14,代碼來源:AppServiceProvider.php

示例13: __construct

 public function __construct()
 {
     if (!Cache::has('accountList')) {
         Cache::put('accountList', DB::select('select full_id, name from full_id where cast(concat(parent_id,id) as UNSIGNED) not in (select parent_id from account)'), 60);
     }
     if (!Cache::has('events')) {
         Cache::put('events', Event::all(), 60);
     }
 }
開發者ID:seisyo,項目名稱:Verthandi,代碼行數:9,代碼來源:DiaryController.php

示例14: up

 /**
  * Run the migrations.
  *
  * @return void
  */
 public function up()
 {
     Schema::table('events', function (Blueprint $table) {
         $table->string('slug')->after('creator_id');
     });
     // Set any missing slugs
     foreach (\App\Event::all() as $event) {
         $event->sluggify();
         $event->save();
     }
 }
開發者ID:natalieduong,項目名稱:konnection,代碼行數:16,代碼來源:2015_05_16_022432_add_slug_to_events.php

示例15: getHome

 public function getHome()
 {
     $varr = Auth::user()->empid;
     $evarr = User::where('empid', $varr)->get();
     $edetails = Employee::where('emp_ide_id', $varr)->get();
     $categories = Event::all();
     $employee = Employee::all();
     $invoice = Invoice::all();
     $invnull = Invoice::where('Status', '=', 'Null')->get();
     return View('reviewer/home')->with(array('categories' => $categories, 'employee' => $employee, 'invoice' => $invoice, 'invnull' => $invnull, 'edetails' => $edetails));
 }
開發者ID:harshithanaiduk,項目名稱:iclock-newtheme,代碼行數:11,代碼來源:ReviewerController.php


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