I want to use Laravel to develop an API for my app, and had installed the Homestead, but when I use command "php artisan make:model test" the following warning is displayed:
PHP Warning: date_default_timezone_get(): It is not safe to rely on the system's timezone settings. You are required to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected the timezone 'UTC' for now, but please set date.timezone to select your timezone. in /Users/liyanan/Code/Laravel/vendor/monolog/monolog/src/Monolog/Logger.php on line 311
I have tried to change the php.ini file in /ect like this
[Date]
; Defines the default timezone used by the date functions
; http://php.net/date.timezone
date.timezone = ‘Asia/Tokyo’
And change Laravel's app.php like this
'timezone' => ‘Asia/Tokyo’,
And Laravel's Logger.php like this
date_default_timezone_set(‘Asia/Tokyo’);
if (!static::$timezone) {
static::$timezone = new \DateTimeZone(date_default_timezone_get() ?: ‘Asia/Tokyo’);
}
// php7.1+ always has microseconds enabled, so we do not need this hack
if ($this->microsecondTimestamps && PHP_VERSION_ID < 70100) {
$ts = \DateTime::createFromFormat('U.u', sprintf('%.6F', microtime(true)), static::$timezone);
} else {
$ts = new \DateTime(null, static::$timezone);
}
$ts->setTimezone(static::$timezone);
But it did not work, hope somebody could help me. Thanks.