本文整理汇总了PHP中app\Event类的典型用法代码示例。如果您正苦于以下问题:PHP Event类的具体用法?PHP Event怎么用?PHP Event使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了Event类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: update
/**
* Update the specified resource in storage.
*
* @param \Illuminate\Http\Request $request
* @param int $id
* @return \Illuminate\Http\Response
*/
public function update(Request $request, Studio $studio, Event $event)
{
$event->update($this->prepare($request, $studio));
$event->pieces()->sync($this->prepareTags($request, 'piece_list'));
$event->categories()->sync($this->prepareTags($request, 'category_list'));
return redirect()->action('Admin\\StudioEventsController@show', [$studio->id, $event->id]);
}
开发者ID:evendev,项目名称:crazy-painter,代码行数:14,代码来源:StudioEventsController.php
示例2: create
public function create(Request $req)
{
$event = new Event();
$event->name = $req->input('name');
$event->save();
return response()->json(['id' => $event->id]);
}
开发者ID:alexalexandresq,项目名称:ConCalendar,代码行数:7,代码来源:EventController.php
示例3: testActivityCanBeAddedToAnEvent1
public function testActivityCanBeAddedToAnEvent1()
{
$this->logIn();
$event = new Event();
$event->name = 'Kokous';
$event->time = '2016-07-25 16:40:00';
$event->place = 'Kolo';
$event->description = 'Iltakokous';
$event->endDate = '2016-07-25 17:20:20';
$event->group_id = self::createTestGroup();
$event->save();
$activity = new Activity();
$activity->name = 'Kalastus';
$activity->guid = 'Guid';
$activity->age_group = 'sudenpennut';
$activity->task_group = 'pohjoinen';
$activity->save();
$event_id = DB::table('events')->where('name', 'Kokous')->value('id');
// Pitää muutta occurensejä käyttämään
/* $this->visit('/events/'. $event_id)
->click('Muuta aktiviteetteja')
->see('Äänestys')
->press('Lisää')
->click('Takaisin')
->see('Äänestys'); */
}
开发者ID:partio-scout,项目名称:kokous_backend,代码行数:26,代码来源:ActivityViewTest.php
示例4: destroy
/**
* Remove the specified resource from storage.
*
* @param \Illuminate\Http\Request
* @param \App\Event $event
* @return \Illuminate\Http\Response
*/
public function destroy(Request $request, Event $event)
{
if ($request->ajax()) {
$event->delete();
return;
}
return redirect(action('EventsController@index'));
}
开发者ID:NuLeaf,项目名称:nuleaf-website,代码行数:15,代码来源:EventsController.php
示例5: store
public function store()
{
$seven_days = 60 * 60 * 24 * 7;
$two_hours = 60 * 60 * 2;
$season = $_REQUEST['season'];
$venue_id = $_REQUEST['venue_id'];
$activity = $_REQUEST['activity'];
$lastSeasonsLeague = League::where('season', $season - 1)->where('venue_id', $venue_id)->where('activity', $activity)->first();
$lastSeasonsLastGame = Event::where('league_id', $lastSeasonsLeague->id)->where('week_num', 'Wild Card')->where('game_num', 1)->first();
$start_dt = $_REQUEST['start_dt'];
$start_dt = $start_dt ? strtotime($start_dt) : strtotime($lastSeasonsLastGame->date) + $seven_days;
$start_wk = $_REQUEST['start_wk'];
$start_wk -= 1;
$week_cnt = $_REQUEST['week_cnt'];
$game_cnt = $_REQUEST['game_cnt'];
$games_tm = $_REQUEST['games_tm'];
$games_tm = $games_tm ? strtotime($games_tm) : strtotime($lastSeasonsLastGame->time);
$events = [];
for ($i = $start_wk; $i <= $week_cnt; $i++) {
$week_num = $i == $week_cnt ? 'Wild Card' : $i + 1;
for ($j = 0; $j < $game_cnt; $j++) {
$datetime = date('Y-m-d', $start_dt + $seven_days * $i) . ' ' . date('H:i:s', $games_tm + $two_hours * $j);
$game_num = $j + 1;
$league = League::where('season', $season)->where('venue_id', $venue_id)->where('activity', $activity)->first();
if (!$league) {
$league = new League();
$league->season = $season;
$league->venue_id = $venue_id;
$league->activity = $activity;
$league->save();
}
$event = new Event();
$event->league_id = $league->id;
$event->season = $league->season;
$event->venue_id = $league->venue_id;
$event->datetime = $datetime;
$event->week_num = $week_num;
$event->game_num = $game_num;
$event->activity = $league->activity;
$events[] = $event;
}
}
try {
DB::transaction(function () use($events) {
foreach ($events as $event) {
$event->save();
}
});
$_SESSION['ALERT'] = alert('Season Added!', "Season {$season} for " . Venue::find($venue_id)->name . " was created successfully.", 'success');
} catch (Excepton $e) {
print_r($e);
exit;
$_SESSION['ALERT'] = alert('Season Not Added!', "Season {$season} for " . Venue::find($venue_id)->name . " could not be created.", 'error');
}
return redirect('/seasons');
}
开发者ID:MadeByGlutard,项目名称:GreenMountainGaming.com,代码行数:56,代码来源:SeasonsController.php
示例6: newEvent
public function newEvent($user)
{
$event = new Event();
$event->user_id = $user->id;
$event->event_icon = Input::get('icon');
$event->event_title = Input::get('title');
$event->event_description = Input::get('description');
$event->event_date = Input::get('date');
$event->event_color = Input::get('color');
$event->save();
}
开发者ID:mathewsandi,项目名称:Practice,代码行数:11,代码来源:CalendarRepository.php
示例7: toggleParticipant
protected function toggleParticipant(Event $event)
{
$isParticipant = !empty(EventUser::where('user_id', $this->request->participant_id)->where('event_id', $event->id)->first());
if ($isParticipant) {
$event->users()->detach([$this->request->participant_id]);
$value = -1;
} else {
$event->users()->attach([$this->request->participant_id]);
$value = 1;
}
return data([compact('value')]);
}
开发者ID:Techraav,项目名称:n2i,代码行数:12,代码来源:EventController.php
示例8: run
/**
* Run the database seeds.
*
* @return void
*/
public function run()
{
$event = new Event();
$event->description = 'Crack and solve puzzles to find the answer.';
$event->end_date = Carbon::now()->toIso8601String();
$event->featured = true;
$event->image = 'heist.png';
$event->group_id = 1;
$event->location = 'GOL-1670';
$event->name = 'The Heist';
$event->short_description = 'Crack and solve puzzles to find the answer.';
$event->short_name = 'Heist';
$event->start_date = Carbon::now()->toIso8601String();
$event->save();
}
开发者ID:kocsenc,项目名称:api,代码行数:20,代码来源:EventTableSeeder.php
示例9: run
/**
* Run the database seeds.
*
* @return void
*/
public function run()
{
Model::unguard();
$faker = \Faker\Factory::create();
$user = User::create(['name' => 'Christian Kasperbauer', 'email' => '[email protected]', '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
示例10: 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
示例11: index
/**
* Render front page view
* @return VIEW welcome
*/
public function index()
{
$all_events = Event::where('time', '>', date('Y-m-d H:i:s'))->orderBy(DB::raw('RAND()'));
$first_six = $all_events->take(6)->get();
$next_six = $all_events->skip(6)->take(6)->get();
return View::make('welcome')->with('first_six', $first_six)->with('next_six', $next_six);
}
开发者ID:boregan,项目名称:lowdown,代码行数:11,代码来源:UserController.php
示例12: 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
示例13: 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
示例14: index
/**
* Display a listing of the resource.
*
* @return Response
*/
public function index()
{
$lastPosts = Post::latest()->take(2)->get();
$lastEvents = Event::latest()->take(2)->get();
$lastEvents2 = Event::latest()->skip(2)->take(2)->get();
return view('welcome')->with('lastPosts', $lastPosts)->with('lastEvents', $lastEvents)->with('lastEvents2', $lastEvents2);
}
开发者ID:Zizazao,项目名称:evolutizalocal,代码行数:12,代码来源:indexController.php
示例15: store
/**
* Store a newly created resource in storage.
*
* @return Response
*/
public function store(CrearCultiuRequest $request)
{
//dd("Hola");
$cultiu = new Cultiu($request->all());
$cultiu->save();
$event = new Event();
$event->headline = "Inici";
$event->text = "Benvingut";
$event->startDate = $cultiu->startDate;
$event->endDate = $cultiu->startDate;
$event->tevent_id = 1;
$cultiu->save();
$event->cultiu_id = $cultiu->id;
$event->save();
// return redirect('home/cultiu/'.$cultiu->id);
}
开发者ID:vi1004t,项目名称:pfg,代码行数:21,代码来源:CultiuController0.php
示例16: index
/**
* Display a listing of the resource.
*
* @return \Illuminate\Http\Response
*/
public function index()
{
$events = Event::where('user_id', $user_id)->get();
$jobs = Job::where('user_id', $user_id)->get();
// return view('members.dashboardpage', ['user' => $user, 'events' => $events, 'jobs' => $jobs]);
return view('public.frontpage', ['user' => $user, 'events' => $events, 'jobs' => $jobs]);
}
开发者ID:bituka,项目名称:LaravelPHStaticPage,代码行数:12,代码来源:HomeController.php
示例17: up
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
$u = User::create(['first_name' => 'test', 'last_name' => 'test', 'email' => '[email protected]', 'level' => 1]);
$u2 = User::create(['first_name' => 'test2', 'last_name' => 'test2', 'email' => '[email protected]', 'level' => 1]);
$u3 = User::create(['first_name' => 'test3', 'last_name' => 'test3', 'email' => '[email protected]', 'level' => 2]);
$e1 = Event::create(['name' => 'test event', 'user_id' => 3, 'slug' => 'test-event-1', 'date' => '2016-10-17', 'start' => '18:00:00', 'end' => '5:00:00']);
$e2 = Event::create(['name' => 'test event', 'user_id' => 1, 'slug' => 'test-event-2', 'date' => '2016-08-22', 'start' => '19:00:00', 'end' => '5:00:00']);
Event::create(['name' => 'test event', 'user_id' => 2, 'slug' => 'test-event-3', 'date' => '2017-01-07', 'start' => '18:00:00', 'end' => '5:00:00']);
$p1 = Playlist::create(['name' => 'Playlist principale !']);
$p2 = Playlist::create(['name' => 'The Playlist !']);
$p3 = Playlist::create(['name' => 'Playlist secondaire']);
Playlist::create(['name' => 'The Playlist !']);
$p1->styles()->sync([1, 2, 3]);
$p2->styles()->sync([1, 4]);
$p3->styles()->sync([1, 3, 5, 7]);
$e1->playlists()->sync([1, 3]);
$e2->playlists()->sync([2]);
Comment::create(['event_id' => 2, 'user_id' => 2, 'content' => 'Sooo goooood']);
Comment::create(['event_id' => 3, 'user_id' => 2, 'content' => 'Sooo goooood :D']);
Comment::create(['event_id' => 2, 'user_id' => 3, 'content' => 'Sooo goooood !!!']);
Video::create(['url' => '7l48bfQuJeE', 'artist' => 'Chill Bump', 'name' => 'Lost In The Sound', 'tags' => 'chill bump lost in the sound']);
Video::create(['url' => 'XxdPJvhQaMU', 'artist' => 'Chill Bump', 'name' => 'Water boycotter', 'tags' => 'chill bump water boycotter']);
Video::create(['url' => 'kWXAYDQ_K7k', 'artist' => 'Chill Bump', 'name' => 'The Memo', 'tags' => 'chill bump the memo']);
$pivot1 = $p1->videos()->sync([1, 3]);
$pivot2 = $p2->videos()->sync([2]);
$pivot3 = $p3->videos()->sync([1, 2, 3]);
News::create(['title' => 'news test', 'content' => 'Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. ', 'user_id' => 2, 'slug' => 'text-news-1']);
News::create(['title' => 'news test 2', 'content' => 'Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. ', 'user_id' => 3, 'slug' => 'text-news-2']);
Article::create(['title' => 'Article test 1', 'content' => 'Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. ', 'user_id' => 2, 'slug' => 'text-article-1']);
Article::create(['title' => 'Article test 2', 'content' => 'Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. ', 'user_id' => 3, 'slug' => 'text-article-2', 'event_id' => 2]);
}
开发者ID:Techraav,项目名称:djMaker,代码行数:36,代码来源:2017_06_10_032123_create_base_entries.php
示例18: editTimeline
/**
* Edit timeline /
*/
public function editTimeline($timeline_id, Request $request)
{
$timeline = \App\Timeline::where('id', '=', $timeline_id)->first();
$timeline_events = $timeline->event()->orderBy('start_date')->get();
if ($request->input('showForm') == 'true') {
return view('timelines.editTimeline')->with('showForm', 'true')->with('timeline', $timeline)->with('timeline_events', $timeline_events);
} else {
// Else submit form
// Validate the request data
$this->validate($request, ['name' => 'required']);
$user = \Auth::user();
$timeline->name = $request->input('name');
$timeline->description = $request->input('description');
$timeline->last_modified_by = $user->id;
$timeline->save();
// Delete events
for ($e = 0; $e < count($timeline_events); $e++) {
if ($request->input('delete_event' . $e) == 'true') {
\DB::table('character_event')->where('event_id', '=', $timeline_events[$e]->id)->delete();
\DB::table('event_location')->where('event_id', '=', $timeline_events[$e]->id)->delete();
$event = \App\Event::where('id', '=', $timeline_events[$e]->id)->first();
if ($event) {
$event->delete();
}
}
}
// Return success message
return view('timelines.editTimeline')->with('showForm', 'false')->with('timeline', $timeline);
}
}
开发者ID:andrewkramer,项目名称:p4,代码行数:33,代码来源:TimelinesController.php
示例19: postTask
function postTask(Request $request)
{
$task = $request->all();
Task::create($task);
$comm = Committee::where('id', $task['comm_id'])->first();
$evnt = Event::where('id', $comm['event_id'])->first();
//UPDATING WEIGHT OF COMMITTEE AND EVENT
$comm->increment('weight', $task['weight']);
$evnt->increment('weight', $task['weight']);
//UPDATING PROGRESS OF COMMITTEE
$progress = 0;
$tasks = Task::where('comm_id', $comm->id)->get();
foreach ($tasks as $task1) {
$progress += $task1->weight * $task1->progress;
}
$progress = $progress / $comm->weight;
$comm->progress = $progress;
$comm->save();
//UPDATING PROGRESS OF EVENT
$progress2 = 0;
$committees = Committee::all();
foreach ($committees as $committee) {
if ($committee->event_id == $evnt->id) {
$progress2 += $committee->weight * $committee->progress;
}
}
$progress2 = $progress2 / $evnt->weight;
$evnt->progress = $progress2;
$evnt->save();
return redirect('profile');
}
开发者ID:zoekayvee,项目名称:YSESTracker,代码行数:31,代码来源:TaskController.php
示例20: run
/**
* Run the database seeds.
*
* @return void
*/
public function run()
{
//Unguard
Model::unguard();
DB::statement('SET FOREIGN_KEY_CHECKS=0;');
//Truncate
Participant::truncate();
//Event::truncate();
Tag::truncate();
Post::truncate();
//Image::truncate();
DB::statement('TRUNCATE `taggables`;');
//DB::statement('TRUNCATE `imagables`;');
DB::statement('TRUNCATE `participations`;');
DB::statement('TRUNCATE `albumables`;');
Event::reindex();
Participant::reindex();
User::reindex();
Album::reindex();
//Call
$this->call(ParticipantTableSeeder::class);
$this->call(EventTableSeeder::class);
$this->call(TagTableSeeder::class);
//Reguard
Model::reguard();
DB::statement('SET FOREIGN_KEY_CHECKS=1;');
}
开发者ID:jentleyow,项目名称:pcf,代码行数:32,代码来源:DatabaseSeeder.php
注:本文中的app\Event类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论