diff --git a/CHANGELOG.md b/CHANGELOG.md index ce1928b..ed7304d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,9 +2,12 @@ All notable changes to `laravel-convert-timezone` will be documented in this file -## 1.0.1 - 2020-10-11 +## 1.1.1 - 2020-10-21 +- add Lumen support + +## 1.0.1 - 2020-10-11 - move package related models into tests directory -## 1.0.0 - 2020-09-23 +## 1.0.0 - 2020-09-23 - initial release diff --git a/README.md b/README.md index 5ba9681..fe661fc 100644 --- a/README.md +++ b/README.md @@ -9,16 +9,22 @@ A minimal package to convert any model's datetime fields from UTC to desired tim ## Installation +####Laravel You can install the package via composer: - ```bash composer require brainlet-ali/laravel-convert-timezone ``` - You can publish the config file with: ```bash php artisan vendor:publish --provider="Brainlet\LaravelConvertTimezone\LaravelConvertTimezoneServiceProvider" --tag="config" ``` +####Lumen +Add this into your service providers in bootstrap/app.php: +```bash +$app->register(Brainlet\LaravelConvertTimezone\LaravelConvertTimezoneServiceProvider::class); +``` +Copy vendor/brainlet-ali/config/tz.php into your config directory + This is the contents of the published config file: diff --git a/src/Helpers.php b/src/Helpers.php new file mode 100644 index 0000000..c4b48c9 --- /dev/null +++ b/src/Helpers.php @@ -0,0 +1,12 @@ +app->runningInConsole()) { + if (Helpers::isLaravel() && $this->app->runningInConsole()) { $this->publishes([ __DIR__.'/../config/tz.php' => config_path('tz.php'), ], 'config');