Skip to content

Commit 02d51c2

Browse files
committedJan 9, 2020
Shifting the examples higher up the README
1 parent 0d9f69d commit 02d51c2

File tree

1 file changed

+25
-26
lines changed

1 file changed

+25
-26
lines changed
 

‎README.md

+25-26
Original file line numberDiff line numberDiff line change
@@ -43,31 +43,6 @@ Run the database migrations. This will add a `timezone` column to your `users` t
4343
php artisan migrate
4444
```
4545

46-
## Flash Messages
47-
48-
By default when the timezone has been set there is a flash message set in the session. There is an optional integration to use [laracasts/flash](https://github.com/laracasts/flash) package if you wish. Just publish the config options (info below) and override the default settings.
49-
50-
51-
## Overwrite existing timezones in the database
52-
53-
By default, the timezone will be overwritten at each login with the current user timezone. This behavior can be restricted to only update the timezone if it is blank by setting the `'overwrite' => false,` config option (info below).
54-
55-
## Custom Configuration
56-
57-
Publishing the config file is optional.
58-
59-
There isn't much to configure right now. You only need to do this if you want to use Laracast Flash Messages or restrict overwriting the database.
60-
61-
```php
62-
php artisan vendor:publish --provider="JamesMills\LaravelTimezone\LaravelTimezoneServiceProvider" --tag=config
63-
```
64-
65-
If you wish to customise the underlying `torann/geoip` package you can publish the config file by using the command below.
66-
67-
```php
68-
php artisan vendor:publish --provider="Torann\GeoIP\GeoIPServiceProvider" --tag=config
69-
```
70-
7146
## Examples
7247

7348
### Showing date/time to the user in their timezone
@@ -106,7 +81,6 @@ And with custom formatting
10681
// 2018-07-04 3:32 New York, America
10782
```
10883

109-
11084
### Saving the users input to the database in UTC
11185

11286
This will take a date/time, set it to the users timezone then return it as UTC in a Carbon instance.
@@ -118,6 +92,31 @@ $post = Post::create([
11892
]);
11993
```
12094

95+
## Flash Messages
96+
97+
By default when the timezone has been set there is a flash message set in the session. There is an optional integration to use [laracasts/flash](https://github.com/laracasts/flash) package if you wish. Just publish the config options (info below) and override the default settings.
98+
99+
100+
## Overwrite existing timezones in the database
101+
102+
By default, the timezone will be overwritten at each login with the current user timezone. This behavior can be restricted to only update the timezone if it is blank by setting the `'overwrite' => false,` config option (info below).
103+
104+
## Custom Configuration
105+
106+
Publishing the config file is optional.
107+
108+
There isn't much to configure right now. You only need to do this if you want to use Laracast Flash Messages or restrict overwriting the database.
109+
110+
```php
111+
php artisan vendor:publish --provider="JamesMills\LaravelTimezone\LaravelTimezoneServiceProvider" --tag=config
112+
```
113+
114+
If you wish to customise the underlying `torann/geoip` package you can publish the config file by using the command below.
115+
116+
```php
117+
php artisan vendor:publish --provider="Torann\GeoIP\GeoIPServiceProvider" --tag=config
118+
```
119+
121120
## Treeware
122121

123122
You're free to use this package, but if it makes it to your production environment I would highly appreciate you buying the world a tree.

0 commit comments

Comments
 (0)
Please sign in to comment.