Skip to content

Instantly share code, notes, and snippets.

@samhk222
Created December 18, 2020 20:10
Show Gist options
  • Save samhk222/e19374a23cfbdd4ac4f06618fcdf02af to your computer and use it in GitHub Desktop.
Save samhk222/e19374a23cfbdd4ac4f06618fcdf02af to your computer and use it in GitHub Desktop.
Fixing laravel monolog timezone
<?php
namespace App\Providers;
use Illuminate\Support\Facades\Log;
use Illuminate\Support\ServiceProvider;
class AppServiceProvider extends ServiceProvider
{
/**
* Bootstrap any application services.
*
* @return void
*/
public function boot()
{
//
}
/**
* Register any application services.
*
* @return void
*/
public function register()
{
Log::setTimezone(new \DateTimeZone('UTC'));
$this->app->singleton(\Faker\Generator::class, function () {
return \Faker\Factory::create('pt_BR');
});
if ($this->app->environment() === "local") {
$this->app->register(\Barryvdh\LaravelIdeHelper\IdeHelperServiceProvider::class);
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment