当前位置: 首页>>代码示例>>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;未经允许,请勿转载。