It look You can .. check out http://laravel.com/docs/4.2/database
I know that SqlSrv means Microsoft SQL Server..
Laravel works fine with MS SQL Server. Microsoft provides a driver for PHP (several, actually, depending on your SQL version) which you install and enable in your PHP installation.
http://www.microsoft.com/en-nz/download/details.aspx?id=20098
Ok thanks, does this still apply, even if im using Laravel from a on a linux installation? I guess I should have mentioned that from the start :)
No it doesn't - Microsoft's drivers are for Windows-based servers. I seem to recall someone once mentioning FreeTDS - but I don't really know how that works.
I found an old thread that discussed a few options - but it is several months old: http://laravel.io/forum/06-04-2014-laravel-on-opensuse-connecting-to-microsoft-sql-server
Thanks man. I have spent some hours trying with FreeTDS + unixodbc, but with no working solution (yet). I will debug more and possibly open another thread with all the details if that does not work :]
Update:
I managed to get it work. This was done on a CentOS installation. I'll post what I did. Maybe it will help others.
I made sure that FreeTDS and unixODBC was working. By following step 4-6 at this link you can see how to install/test odbc (ignore the perl stuff). Then in app/config/database.php I added:
'sqlsrv' => array(
'driver' => 'sqlsrv',
'host' => 'just_the_hostname_here',
'username' => 'username',
'password' => 'pw',
'database' => 'db_name',
'prefix' => '',
),
..and it works.
Remember to set $connection = 'sqlsrv' in relevant models.
Sign in to participate in this thread!
The Laravel portal for problem solving, knowledge sharing and community building.
The community