Skip to content

Commit 54e97fa

Browse files
author
Toby Allen
committed
readme
1 parent a140fa0 commit 54e97fa

File tree

1 file changed

+43
-0
lines changed

1 file changed

+43
-0
lines changed

readme.md

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
# MSSQL Dateformat Fixer
2+
3+
There is an international date format Y-m-d that is supposed to be universal, however the MSSQL implementation is flawed
4+
and is not universal and incorrect interprets it as Y-d-m which is beyond idiotic.
5+
Laravel uses Y-m-d as their international format, which can lead to errors depending on SQL SERVER Settings.
6+
This command checks the vendor directory for the file and updates it if required.
7+
8+
## Installation
9+
10+
Install with composer
11+
12+
````dotenv
13+
composer require tobya/laravel-mssql-dateformat
14+
````
15+
### To Run
16+
17+
Run by calling the larvel command
18+
19+
````dotenv
20+
artisan mssql:check-universal-date --update
21+
````
22+
You can run without `--update` to do the check without patching the file.
23+
24+
## Configuration
25+
26+
It is suggested that you add the following to your project `composer.json` file so this command is automatically run
27+
on install and update.
28+
29+
````dotenv
30+
31+
"scripts": {
32+
"post-update-cmd": [
33+
"@php artisan mssql:check-universal-date --update"
34+
],
35+
"post-install-cmd": [
36+
"@php artisan mssql:check-universal-date --update"
37+
]
38+
}
39+
````
40+
This is due to the fact that whenever `composer update` or `composer install` is run and the illuminate package
41+
is updated it will overwrite the `SqlServerGrammar.php` with the origional version, so it is necessary to call
42+
the command whenever this has the potential of happening. If no change has been made to the file it will
43+
not be modified.

0 commit comments

Comments
 (0)