Laravel Connecting to SQL Server, MSSQL database - Laravel 5


Here is how to Connect Laravel with SQL Server, MSSQL Database


Laravel makes connecting with SQL Server database and running queries extremely simple out of the box. The SQL Server, MSSQL database configuration for your application is located at Laravel Project Root Folder, config/database.php. In this file you may define SQL Server, MSSQL database connection for your Laravel Application.

'sqlsrv' => [
    'driver' => 'sqlsrv',                                   
    'host' => env('DB_HOST', 'localhost'),// usually localhost, or sql server database ip address   
    'port' => env('DB_PORT', '1433'), //default port 1433, or mention port in which it run on your server if it different
    'database' => env('DB_DATABASE', 'forge'), // mention your sql server database name here  

    'username' => env('DB_USERNAME', 'forge'), //mssql database username 
    'password' => env('DB_PASSWORD', ''),  //mssql database password 
    'charset' => 'utf8',
    'prefix' => '',
],


if you have any questions regarding Laravel SQL Server Database connection,  please feel free to leave your comment bellow.

Written by Akram Wahid 5 years ago

are you looking for a chief cook who can well craft laravel and vuejs, to make some awsome butterscotch,
yes then it is right time for you to look at my profile.

Do you want to write Response or Comment?

You must be a member of techalyst to proceed!

Continue with your Email ? Sign up / log in

Responses

Be the first one to write a response :(

{{ item.member.name }} - {{ item.created_at_human_readable }}

{{ reply.member.name }} - {{ reply.created_at_human_readable }}