Last active
May 13, 2017 07:18
-
-
Save appkr/240d90112f4f1b18ae146d3165a38e68 to your computer and use it in GitHub Desktop.
Timemachine For Testers
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php // app/Providers/AppServiceProvider.php | |
namespace App\Providers; | |
use Carbon\Carbon; | |
class AppServiceProvider extends ServiceProvider | |
{ | |
public function boot() | |
{ | |
Carbon::setTestNow(Carbon::now()->addDays(5)); | |
} | |
} | |
<?php // app/Http/Controllers/HealthController.php | |
namespace App\Http\Controllers; | |
use Carbon\Carbon; | |
class HealthController extends Controller | |
{ | |
public function index() | |
{ | |
return response()->json([ | |
'Date' => Carbon::now()->format('D, d M Y H:i:s').' GMT', | |
], 200, [ | |
'Date' => Carbon::now()->format('D, d M Y H:i:s').' GMT' | |
]); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment