Download the PHP package tobya/laravel-mssql-dateformat without Composer
On this page you can find all versions of the php package tobya/laravel-mssql-dateformat. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download tobya/laravel-mssql-dateformat
More information about tobya/laravel-mssql-dateformat
Files in tobya/laravel-mssql-dateformat
Package laravel-mssql-dateformat
Short Description Check and set MSSQL universal date format used by Laravel to 'Ymd' to ensure universal compatibility
License MIT
Informations about the package laravel-mssql-dateformat
MSSQL Dateformat Fixer
There is an international date format (ISO standard) (YYYY-MM-DD) Y-m-d
that is supposed to be universal, however the MSSQL implementation is flawed
and is NOT universal and incorrectly interprets Y-m-d
as Y-d-m
which is beyond idiotic.
Laravel uses Y-m-d
as their international format, which can lead to errors depending on SQL SERVER Settings.
There is one format Ymd
which is absolutely gauranteed to always be interpreted by SQLServer as Ymd
. This command patches the file in
illuminate library to use Ymd
instead of Y-m-d
. I Requested that the change be made in the illuminate library but it was felt the change
was too big to be made.
I hope this is helpful to those of you out there using MSSQL with PHP/Laravel.
Installation
Install with composer
`
To Run
Run by calling the larvel command
You can run without
--update` to do the check without patching the file.
Configuration
It is suggested that you add the following to your project composer.json
file so this command is automatically run
on install and update.
This is due to the fact that whenever
composer updateor
composer installis run and the illuminate package is updated it will overwrite the
SqlServerGrammar.php` with the origional version, so it is necessary to call
the command whenever this has the potential of happening. If no change has been made to the file it will
not be modified.
Further reading on why this is necessary
This is discussed in several places online