Search
 
SCRIPT & CODE EXAMPLE
 

CSHARP

how create two database conction in laravel

return array(

    'default' => 'mysql',

    'connections' => array(

        # Primary/Default database connection
        'mysql' => array(
            'driver'    => 'mysql',
            'host'      => '127.0.0.1',
            'database'  => 'database1',
            'username'  => 'root',
            'password'  => 'secret'
            'charset'   => 'utf8',
            'collation' => 'utf8_unicode_ci',
            'prefix'    => '',
        ),

        # Secondary database connection
        'mysql2' => array(
            'driver'    => 'mysql',
            'host'      => '127.0.0.1',
            'database'  => 'database2',
            'username'  => 'root',
            'password'  => 'secret'
            'charset'   => 'utf8',
            'collation' => 'utf8_unicode_ci',
            'prefix'    => '',
        ),
    ),
);


in migrations => 

Schema::connection('mysql2')->create('some_table', function($table)
{
    $table->increments('id'):
});
Comment

PREVIOUS NEXT
Code Example
Csharp :: page parent wpf 
Csharp :: gql query with parameters 
Csharp :: foreach for IEnumerable 
Csharp :: c# read string 
Csharp :: system.random reuses numbers 
Csharp :: c# list object 
Csharp :: count number of specific characters in string c# 
Csharp :: ssis sql query in script task 
Csharp :: unity screen size fix 
Csharp :: list to ilist c# 
Csharp :: C# [] overload 
Csharp :: catch multiple exception c# 
Csharp :: c# arrays 
Csharp :: strong email validation regex c# 
Csharp :: delete all fields that start with mongo 
Csharp :: orderby c# 
Csharp :: how to auto format c# code in visual studio 
Csharp :: wpf app transparent background with blurred image affect 
Csharp :: c# how to refresh input field 
Csharp :: wpf rounded button 
Csharp :: Count Rows of table using Linq 
Csharp :: singleton pattern c# stack overflow 
Csharp :: animatro set bool unity 
Csharp :: Photon Register Callbacks 
Csharp :: Set orientation of moving object towards it movement direction without using rigidbody 
Csharp :: psobject get service name 
Csharp :: c# function to validate decimal upto p(25,2) 
Csharp :: List foreach 
Csharp :: vb.net delete line from text file 
Csharp :: take the last 50 from array c# 
ADD CONTENT
Topic
Content
Source link
Name
2+7 =