当前位置: 首页>>代码示例>>PHP>>正文


PHP Carbon::tomorrow方法代码示例

本文整理汇总了PHP中Carbon\Carbon::tomorrow方法的典型用法代码示例。如果您正苦于以下问题:PHP Carbon::tomorrow方法的具体用法?PHP Carbon::tomorrow怎么用?PHP Carbon::tomorrow使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Carbon\Carbon的用法示例。


在下文中一共展示了Carbon::tomorrow方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: conferences_dont_accept_proposals_outside_of_the_call_for_papers

 /** @test */
 public function conferences_dont_accept_proposals_outside_of_the_call_for_papers()
 {
     $conference = Factory::create('conference', ['cfp_starts_at' => Carbon::tomorrow(), 'cfp_ends_at' => Carbon::tomorrow()->addDay()]);
     $this->assertFalse($conference->isCurrentlyAcceptingProposals());
     $conference = Factory::create('conference', ['cfp_starts_at' => Carbon::yesterday()->subDay(), 'cfp_ends_at' => Carbon::yesterday()]);
     $this->assertFalse($conference->isCurrentlyAcceptingProposals());
 }
开发者ID:jwalton512,项目名称:symposium,代码行数:8,代码来源:ConferenceTest.php

示例2: getDateRange

 /**
  * @return array
  */
 private function getDateRange()
 {
     if (is_array($this->dateRange)) {
         return $this->dateRange;
     }
     switch (strtolower($this->dateRange)) {
         case 'today':
             return [$this->carbon->today(), $this->carbon->tomorrow()];
         case 'yesterday':
             return [$this->carbon->yesterday(), $this->carbon->today()];
         case 'thisweek':
             return [$this->carbon->today()->dayOfWeek === 0 ? $this->carbon->today() : $this->carbon->today()->previous(0), $this->carbon->tomorrow()];
         case 'lastweek':
             return [$this->carbon->today()->dayOfWeek === 0 ? $this->carbon->today()->previous(0) : $this->carbon->today()->previous(0)->previous(), $this->carbon->today()->previous(6)->addDay()];
         case 'thismonth':
             return [$this->carbon->today()->startOfMonth(), $this->carbon->tomorrow()];
         case 'lastmonth':
             return [$this->carbon->today()->subMonth()->startOfMonth(), $this->carbon->today()->subMonth()->endOfMonth()];
     }
 }
开发者ID:killtw,项目名称:repository,代码行数:23,代码来源:RangeCriteria.php

示例3: setUp

 public function setUp()
 {
     parent::setUp();
     $this->request = m::mock('\\Illuminate\\Http\\Request');
     $this->themes = new Themes();
     self::$files->shouldReceive('exists')->andReturn(false);
     $this->lastWeek = Carbon::today()->subWeek()->format('Y-m-d');
     $this->yesterday = Carbon::yesterday()->format('Y-m-d');
     $this->today = Carbon::today()->format('Y-m-d');
     $this->tomorrow = Carbon::tomorrow()->format('Y-m-d');
     $this->nextWeek = Carbon::today()->addWeek()->format('Y-m-d');
 }
开发者ID:petercoles,项目名称:themes,代码行数:12,代码来源:MatchDatesTest.php

示例4: testRepoReturnsNullIfNotWorkingDayWithThatDayExists

 /**
  * Tests that getting a task from repo that does not exists by date returns null.
  */
 public function testRepoReturnsNullIfNotWorkingDayWithThatDayExists()
 {
     $this->repo->add($this->workingDayWithTask);
     $nullWorkingDay = $this->repo->getByDate(Carbon::tomorrow());
     $this->assertNull($nullWorkingDay);
     $this->repo->remove($this->workingDayWithTask);
 }
开发者ID:destebang,项目名称:taskreporter-1,代码行数:10,代码来源:DoctrineWorkingDayRepositoryTest.php

示例5: index

 /**
  * Show the application dashboard.
  *
  * @return \Illuminate\Http\Response
  */
 public function index()
 {
     $today = Carbon::today();
     $tomorrow = Carbon::tomorrow();
     $tomorrowbookinguser = Booking::where('bookingdate', '=', $tomorrow)->get();
     $dt = Carbon::now();
     $year = $dt->year;
     $month = $dt->month;
     $currentmonthbreakfast = Booking::where('user_id', Auth::user()->id)->whereMonth('bookingdate', '=', $month)->whereYear('bookingdate', '=', $year)->where('breakfast', '=', 'on')->count();
     $currentmonthlunch = Booking::where('user_id', Auth::user()->id)->whereMonth('bookingdate', '=', $month)->whereMonth('bookingdate', '=', $month)->whereYear('bookingdate', '=', $year)->where('lunch', '=', 'on')->count();
     $currentmonthdinner = Booking::where('user_id', Auth::user()->id)->whereMonth('bookingdate', '=', $month)->whereMonth('bookingdate', '=', $month)->whereYear('bookingdate', '=', $year)->where('dinner', '=', 'on')->count();
     $totalbooking = $currentmonthbreakfast + $currentmonthlunch + $currentmonthdinner;
     $price = Account::whereMonth('accountdate', '=', date('m'))->where('user_id', Auth::user()->id)->sum('amount');
     $todaydayshop = Shop::where('shopdate', $today)->get();
     $tomorrowshop = Shop::where('shopdate', $tomorrow)->get();
     $bookings = Booking::where('bookingdate', '=', $today)->get();
     $breakfast = Booking::where('bookingdate', '=', $today)->where('breakfast', '=', 'on')->count();
     $lunch = Booking::where('bookingdate', '=', $today)->where('lunch', '=', 'on')->count();
     $dinner = Booking::where('bookingdate', '=', $today)->where('dinner', '=', 'on')->count();
     $t_breakfast = Booking::where('bookingdate', '=', $tomorrow)->where('breakfast', '=', 'on')->count();
     $t_lunch = Booking::where('bookingdate', '=', $tomorrow)->where('lunch', '=', 'on')->count();
     $t_dinner = Booking::where('bookingdate', '=', $tomorrow)->where('dinner', '=', 'on')->count();
     $useraccounts = DB::table('useraccounts')->where('user_id', Auth::user()->id)->select('user_id', DB::raw("SUM(foodamount) AS t_foodamount"), DB::raw("SUM(houserent) AS t_houserent"), DB::raw("SUM(internetbill) AS t_internetbill"), DB::raw("SUM(utlitybill) AS t_utlitybill"), DB::raw("SUM(buabill) AS t_buabill"), DB::raw("SUM(pay) AS t_pay"))->get();
     foreach ($useraccounts as $account) {
         $amount = $account->t_foodamount + $account->t_houserent + $account->t_internetbill + $account->t_utlitybill + $account->t_buabill;
         $balance = $amount - $account->t_pay;
     }
     return view('home', ['bookings' => $bookings, 'breakfast' => $breakfast, 'lunch' => $lunch, 'dinner' => $dinner, 't_breakfast' => $t_breakfast, 't_lunch' => $t_lunch, 't_dinner' => $t_dinner, 'tomorrow' => $tomorrow, 'todaydayshop' => $todaydayshop, 'tomorrowshop' => $tomorrowshop, 'tomorrowbookinguser' => $tomorrowbookinguser, 'balance' => $balance, 'currentmonthbreakfast' => $currentmonthbreakfast, 'currentmonthlunch' => $currentmonthlunch, 'currentmonthdinner' => $currentmonthdinner, 'totalbooking' => $totalbooking, 'price' => $price]);
 }
开发者ID:polashmahmud,项目名称:awesomebua,代码行数:34,代码来源:HomeController.php

示例6: test_renderContent_returns_twig_parsed_content

 public function test_renderContent_returns_twig_parsed_content()
 {
     $campaign2 = Campaign::create(['name' => 'Test split2', 'file_name' => 'test-split2.htm', 'file_type' => 'partial', 'start_at' => Carbon::today(), 'end_at' => Carbon::tomorrow(), 'version_a_content' => 'Foo', 'version_b_content' => 'Bar']);
     $campaign1 = Campaign::create(['name' => 'Test split1', 'file_name' => 'test-split1.htm', 'file_type' => 'partial', 'start_at' => Carbon::today(), 'end_at' => Carbon::tomorrow(), 'version_a_content' => 'Hello {{ split(' . $campaign2->id . ') }}', 'version_b_content' => 'World {{ split(' . $campaign2->id . ') }}']);
     $content = CmsHelper::renderContent($campaign1->id);
     $this->assertTrue(in_array($content, ['Hello Foo', 'Hello Bar', 'World Foo', 'World Bar']));
 }
开发者ID:scottbedard,项目名称:oc-splitter-plugin,代码行数:7,代码来源:CmsHelperTest.php

示例7: index

 public function index()
 {
     //using function from the Trait currentDate.
     $targetDay = $this->getCurrentDate();
     //retrieving data for the next 3 days prior and after the currentDate
     $dateDayAfter = Carbon::tomorrow();
     $dateDayBefore = Carbon::yesterday();
     $dateDayAfter2 = Carbon::tomorrow()->addDay();
     $dateDayAfter3 = Carbon::tomorrow()->addDays(2);
     $weekBeforeObject = Carbon::yesterday()->subDays(6);
     $weekAfterObject = Carbon::tomorrow()->addDays(6);
     $dateDayBefore2 = Carbon::yesterday()->subDay();
     $dateDayBefore3 = Carbon::yesterday()->subDays(2);
     //putting the data in the array using the function inside the controller
     $dayAfter = $this->dateObjectToArray($dateDayAfter);
     $dayBefore = $this->dateObjectToArray($dateDayBefore);
     $dayAfter2 = $this->dateObjectToArray($dateDayAfter2);
     $dayAfter3 = $this->dateObjectToArray($dateDayAfter3);
     $dayBefore2 = $this->dateObjectToArray($dateDayBefore2);
     $dayBefore3 = $this->dateObjectToArray($dateDayBefore3);
     $weekBefore = $this->dateObjectToArray($weekBeforeObject);
     $weekAfter = $this->dateObjectToArray($weekAfterObject);
     $data = ['thisDay' => '', 'thisWeek' => "class = active ", 'thisMonth' => '', 'id' => 'thisWeek'];
     // $listdata = $this->listRepository->getLists();
     return view('main-tabs.thisWeek', $data)->with('targetDay', $targetDay)->with('dayBefore', $dayBefore)->with('dayAfter', $dayAfter)->with('dayAfter2', $dayAfter2)->with('dayAfter3', $dayAfter3)->with('dayBefore2', $dayBefore2)->with('dayBefore3', $dayBefore3)->with('weekYearBefore', $weekBefore['currentYear'])->with('weekYearAfter', $weekAfter['currentYear'])->with('weekMonthBefore', $weekBefore['currentMonth'])->with('weekMonthAfter', $weekAfter['currentMonth'])->with('weekDayBefore', $weekBefore['currentDay'])->with('weekDayAfter', $weekAfter['currentDay']);
 }
开发者ID:Timmerdev,项目名称:timmer_app,代码行数:26,代码来源:ListsController.php

示例8: store

 /**
  * Store a newly created resource in storage.
  *
  * @param Request $request
  *
  * @return Response
  */
 public function store(Request $request, Trip $trip)
 {
     $company = Auth::travel_company_staff()->get()->travel_company;
     $stations = $company->stations->lists('city')->toArray();
     $dps = $request->departure_station;
     $des = $request->destination_station;
     $this->validate($request, ['departure_station' => "required | different:destination_station", 'departure_date' => "required", 'departure_time' => 'required', 'destination_station' => "required", 'fare' => 'required', 'transport_model' => 'required', 'hour' => 'integer|required', 'minute' => 'integer|required', 'boarding_point' => 'required', 'number_of_seats' => 'required|integer']);
     if (!in_array($dps, $stations) or !in_array($des, $stations)) {
         return redirect()->back()->withInput()->withErrors('Invalid Station');
     }
     $departure_date = $this->carbonize($request->departure_date);
     if ($departure_date->lte(Carbon::tomorrow())) {
         return redirect()->back()->withInput()->withErrors('Invalid Departure Date');
     }
     $min = $request->minute;
     $hour = $request->hour;
     $duration = $this->durationize($hour, $min);
     $slug = str_slug($request->departure_station . ' to ' . $request->destination_station);
     $code = $trip->code();
     $input = array_add($request->except(['minute', 'hour']), 'code', $code);
     $input['departure_date'] = $departure_date;
     $input = array_add($input, 'travel_company_id', $company->id);
     $input = array_add($input, 'duration', $duration);
     $input = array_add($input, 'slug', $slug);
     Trip::create($input);
     return redirect()->route('company.trips.index');
 }
开发者ID:thomasdola,项目名称:afrouteWeb,代码行数:34,代码来源:CompaniesTripsController.php

示例9: testWillExpire

 public function testWillExpire()
 {
     $job = new Job();
     $this->assertFalse($job->willExpire());
     $job->expires_at = Carbon::tomorrow();
     $this->assertTrue($job->willExpire());
 }
开发者ID:sellerlabs,项目名称:illuminated,代码行数:7,代码来源:JobTest.php

示例10: testRepoReturnsNullIfNotWorkingDayWithThatDayExists

 /**
  * Tests that getting a task from repo that does not exists by date returns null.
  */
 public function testRepoReturnsNullIfNotWorkingDayWithThatDayExists()
 {
     $this->workingDayWithTask = $this->getWorkingDayWithTask();
     $this->inMemoryRepo->add($this->workingDayWithTask);
     $nullWorkingDayFromRepo = $this->inMemoryRepo->getByDate(Carbon::tomorrow());
     $this->assertNull($nullWorkingDayFromRepo);
 }
开发者ID:nubeiro,项目名称:taskreporter,代码行数:10,代码来源:InMemoryWorkingDayRepositoryTest.php

示例11: index

 public function index()
 {
     //getting the date today, and finding the corresponding list to it.
     $dateToday = $this->getCurrentDate();
     $dateObjectYesterday = Carbon::yesterday();
     $dateObjectTomorrow = Carbon::tomorrow();
     $dateArrayYesterday = $this->dateObjectToArray($dateObjectYesterday);
     $dateArrayTomorrow = $this->dateObjectToArray($dateObjectTomorrow);
     $dayBefore = $dateArrayYesterday['currentDay'] . "/" . $dateArrayYesterday['currentMonth'] . "/" . $dateArrayYesterday['currentYear'];
     $dayAfter = $dateArrayTomorrow['currentDay'] . "/" . $dateArrayTomorrow['currentMonth'] . "/" . $dateArrayTomorrow['currentYear'];
     //checks if a lists exists for a corresponnding date. If there is no list, returns a null value.
     $currentList = $this->listRepository->getSpecificList($dateToday['currentDay'] . "/" . $dateToday['currentMonth'] . "/" . $dateToday['currentYear']);
     if (!empty($currentList)) {
         $currentListID = $currentList->id;
         $logsData = $this->logRepository->getSpecificLogsByList($currentListID);
         if ($logsData->isEmpty()) {
             $logsData = null;
         }
     } else {
         $logsData = null;
     }
     $data = ['thisDay' => "class = active ", 'thisWeek' => '', 'thisMonth' => '', 'id' => 'thisDay'];
     $dayName = $dateToday['currentDayName'];
     $monthName = $dateToday['currentMonthName'];
     $day = $dateToday['currentDay'];
     $year = $dateToday['currentYear'];
     return view('main-tabs.thisDay', $data)->with('logsData', $logsData)->with('dayBefore', $dayBefore)->with('dayAfter', $dayAfter)->with('dayName', $dayName)->with('monthName', $monthName)->with('day', $day)->with('year', $year);
 }
开发者ID:Timmerdev,项目名称:timmer_app,代码行数:28,代码来源:LogController.php

示例12: createformat

 public function createformat()
 {
     $today = rtrim(Carbon::today()->formatLocalized('%A %e'), '.');
     $tomorrow = rtrim(Carbon::tomorrow()->formatLocalized('%A %e'), '.');
     $week = rtrim(Carbon::today()->formatLocalized('%e %b'), '.') . ' - ' . rtrim(Carbon::today()->addWeek()->formatLocalized('%e %b'), '.');
     $weekend = rtrim(Carbon::today()->parse('next saturday')->formatLocalized('%e %b'), '.') . ' - ' . rtrim(Carbon::today()->parse('next sunday')->formatLocalized('%e %b'), '.');
     $month = rtrim(Carbon::today()->formatLocalized('%e %b'), '.') . ' - ' . rtrim(Carbon::today()->addMonth()->formatLocalized('%e %b'), '.');
     return $dateformat = ['today' => $today, 'tomorrow' => $tomorrow, 'week' => $week, 'weekend' => $weekend, 'month' => $month];
 }
开发者ID:eMedin4,项目名称:ensured,代码行数:9,代码来源:HeaderComposer.php

示例13: book

 public function book()
 {
     $now = Carbon::now();
     $tomorrow = Carbon::tomorrow();
     $nowString = '';
     //$now->format('d/m/Y 10:00');
     $tomorrowString = '';
     //$tomorrow->format('d/m/Y 10:00');
     return view('home.book', compact('nowString', 'tomorrowString'));
 }
开发者ID:adhatama,项目名称:piaggio,代码行数:10,代码来源:HomeController.php

示例14: seedDiscounts

 public function seedDiscounts()
 {
     $expired = Factory::create(new Discount(), ['start_at' => null, 'end_at' => Carbon::yesterday()]);
     $running = Factory::create(new Discount(), ['start_at' => Carbon::yesterday(), 'end_at' => Carbon::tomorrow()]);
     $running->products()->sync([1, 2, 3]);
     $running->save();
     $upcoming = Factory::create(new Discount(), ['start_at' => Carbon::tomorrow(), 'end_at' => null]);
     $upcoming->categories()->sync([5]);
     $upcoming->save();
 }
开发者ID:scottbedard,项目名称:oc-shop-plugin,代码行数:10,代码来源:dev_seeds.php

示例15: testServiceAddTournamentRepoCalled

 /**
  * Tests if the service's add tournament
  * works as supposed.
  */
 public function testServiceAddTournamentRepoCalled()
 {
     $name = 'tournament name';
     $fakeAdmin = m::mock('App\\Models\\Administrator');
     $fakeTournament = m::mock('App\\Models\\Tournament');
     \Admin::shouldReceive('getLogged')->once()->andReturn($fakeAdmin);
     $this->fakeTournamentsRepo->shouldReceive('addTournament')->withArgs([m::type('App\\Models\\Administrator'), $name, m::type('\\Carbon\\Carbon'), m::type('\\Carbon\\Carbon'), false])->once()->andReturn($fakeTournament);
     $tournament = $this->service->addTournament($name, \Carbon\Carbon::now(), \Carbon\Carbon::tomorrow(), false);
     $this->assertEquals($tournament, $fakeTournament);
 }
开发者ID:TiagoMaiaL,项目名称:Tournament-Manager,代码行数:14,代码来源:TournamentsServiceUnitTest.php


注:本文中的Carbon\Carbon::tomorrow方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。