本文整理汇总了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();
}
示例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));
}
示例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));
}
示例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'));
}
示例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()]);
}
示例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;
}
示例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);
}
示例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'));
}
示例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));
}
示例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'));
}
示例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]);
}
示例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());
});
}
示例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);
}
}
示例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();
}
}
示例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));
}