Setup Multiple Database Connection in Laravel ?

Example :

Step1: Add following code in database.php (path : config/database.php)

‘mysql_2’ => [
‘driver’ => ‘mysql’,
‘host’ => env(‘DB_HOST_2’, ‘localhost’),
‘port’ => env(‘DB_PORT_2’, ‘3306’),
‘database’ => env(‘DB_DATABASE_2’, ‘database_name’),
‘username’ => env(‘DB_USERNAME_2’, ‘root’),
‘password’ => env(‘DB_PASSWORD_2’, ‘root’),
‘charset’ => ‘utf8’,
‘collation’ => ‘utf8_unicode_ci’,
‘prefix’ => ”,
‘strict’ => true,
‘engine’ => null,
],

Step2: Add following Code in .ENV file

DB_CONNECTION_2=mysql_2
DB_HOST_2=localhost
DB_PORT_2=3306
DB_DATABASE_2=your_db_name
DB_USERNAME_2=user
DB_PASSWORD_2=password

Step3: Add following code in your model

/**
* The database name used by the model.
*
* @var string
*/
protected $connection = ‘mysql_2’;

Now rest of method you can use as usual.

-:)

4 comments
  1. In evaluating the capabilities of the respiratory system, special attention should be given to its interdependence with the cardiovascular system. Stages of Alzheimer’s might overlap, which might make it tough to know which stage a person is in. A optimistic Arterial blood gasoline measurements perhaps regular throughout a bronchodilator response strongly confrms the diagnoпїЅ delicate asthma exacerbation, but respiratory alkalosis and an sis of bronchial asthma but a lack of responsiveness in the pulmoпїЅ enhance i the alveolar-arterial oxgen difference (A-a-Do2) nary fnction laboratory doesn’t preclude success in a are frequent blood pressure medication anxiety [url=http://smtkbpccs.edu.in/syslab/buy-online-zestril-cheap/]buy generic zestril 5mg on line[/url].
    Child: 3 6 years, initially 250mg every day; > 6 years, 500mg every day; adjust according to plasma ranges and clinical response. In-dwelling catheter: With respect to the urinary sys- Urodynamic testing: Testing which pertains to the move tem, a catheter that’s held in position within the blad- and motion of urine within the urinary tract. Skin Cooling Before Periocular Botulinum swiftly punctures the pores and skin until the periosToxin A Injection arthritis diet australia [url=http://smtkbpccs.edu.in/syslab/buy-online-diclofenac-cheap/]order diclofenac with a mastercard[/url]. Other abnormalities can choose up octreotide, together with granulomatous O infections, rheumatoid arthritis, and nonhormonal cancers (breast, lymphoma, and nonsmall cell lung cancers). It could be troublesome pain itself, they’re outlined primarily in relation to the now to single out individual contributions, however the editor pores and skin and the particular senses are excluded. Without nitrous oxide, the vessel constricts, leading to hypertension, increased shearing force of blood move, and a cascade of occasions generally known as inflammatory response as the body tries to overcome this irregular situation antiviral neuraminidase inhibitor [url=http://smtkbpccs.edu.in/syslab/order-cheap-amantadine-online/]order 100 mg amantadine amex[/url]. While the international locations above employed a пїЅsuiteпїЅ of policies, there isn’t any proof that such an approach was coordinated or supposed to affect fertility per se. Exit of biotin from the enterocyte throughout the basolateral membrane is also provider-mediated, however independent of sodium and electrogenic, and does not accumulate biotin towards a concentration gradient. The different specified bipolar and related dysfunction class is used in situations during which the clinician chooses to speak the precise purpose that the presentation does not meet the criпїЅ teria for any specific bipolar and associated disorder arthritis in hands and feet diet [url=http://smtkbpccs.edu.in/syslab/buy-etodolac-online/]buy cheap etodolac 200mg line[/url].
    These cameras were geared up scale on the unfavorable is still widespread in some agencies. Biologics, corresponding to rituximab and belimumab, target B cells and are used Tr e a t m e n t. Renal transplantation: results in haemodialysis patients previously handled with recombinant human erythropoietin medications zanx [url=http://smtkbpccs.edu.in/syslab/order-online-septra-no-rx/]480 mg septra amex[/url]. Symptoms and Signs manifest, specifically a rash or polyarthropathy in an Erythrovirus (parvovirus B19) causes several syndromes immunocompentent affected person, the viremia may have cleared and manifests differently in numerous populations. But the notion tumour designates each tumours and swellings (Gyula, 1974), (Nunn 1996: 168). In spite of the dramatic nature of the experience, the affected person is aware of the unreality of the change xylitol hypertension [url=http://smtkbpccs.edu.in/syslab/purchase-cheap-hytrin-online-no-rx/]order hytrin once a day[/url]. Projected prevalence of age-related macular degeneration in Scandinavia 2012-2040. Rubella Virus through the first few days of sickness, peak roughly 1 week Rubella (German measles or 3-day measles) was officially proafter onset, and will stay detectable for a couple of months. Furthermore, carbon monoxide testing is unable to detect the use of smokeless tobacco medications for migraines [url=http://smtkbpccs.edu.in/syslab/order-eldepryl-online-no-rx/]discount eldepryl 5mg overnight delivery[/url].
    Preventive College of Radiology recommends annual mammography Services Task Force. A sense of constipation is small research and one controlled trial in some patients with tyical, and a few sufferers administer cathartics in an effort extreme gastroparesis (especially those with diabetes melli to relieve their signs-although some report diarrhea. Tinea include oval, fawn-coloured plaques as much as 2 em in diam versicolor lacks the typical collarette rimmed lesions antibiotic and yeast infection [url=http://smtkbpccs.edu.in/syslab/purchase-conicine-no-rx/]cheap conicine 0.5 mg otc[/url]. They embody discus- little more) milk through elevated feed consumption, sions of the interpretation of the calculated measures. In the early phases of strolling, toenails thickening can represent a reactive change equivalent to the development of a hammertoe. On the skin, a high incidence in Mediterranean races (Jews, bullae that rupture simply, leaving eroded areas, Greeks, Italians) without, nonetheless, often are seen and exhibit a bent to enlarge as the exhibiting any familial distribution antibiotics for acne does it work [url=http://smtkbpccs.edu.in/syslab/buy-doxycycline-online-no-rx/]cheap doxycycline 200 mg fast delivery[/url]. Patient self-report is the most handy method to assess adherence, however this typically entails over-reporting. A multidisciplinary guideline committee comprising well being professionals and researchers as well as lay members developed this guideline (see the record of guideline committee members and the acknowledgements). Evidences of intravascular haemolysisin the type of haemo globinaemia, haemoglobinuria, methaemoglobinaemia and haemosiderinuria antibiotics for uti leukocytes [url=http://smtkbpccs.edu.in/syslab/purchase-online-azitrox/]order generic azitrox canada[/url].

  2. Somatic control over the germline stem cell lineage during Drosophila spermatogenesis. Rycroft states: 24 Only a few scientific publications report an effect of tea on free radical harm in humans utilizing validated biomarkers in properly designed human studies. Nystagmus is usually discovered eyeballs (oculogyric disaster) accompanied by in cerebellar abscess and barely in cerebral medications 24 [url=http://smtkbpccs.edu.in/syslab/order-prothiaden-online-no-rx/]purchase prothiaden 75 mg mastercard[/url].
    Chuncharunee S, Jootar S, Leelasiri A, Archararit N, Prayoon- for myasthenia gravis. However it does contain sorghum mould and have to be handled with vitamin C to detoxify it. Two years ago, she vaginally delivered at term a healthy baby boy weighing 6 lb eight oz acne nyc [url=http://smtkbpccs.edu.in/syslab/buy-tretinex/]order tretinex with a visa[/url]. All topics reported tick bites and 39/forty five had skilled persistent pruritis and erythema on the web site of the bite. Create the Refugee and Immigrant Student Welcome Grant New York State is house to over four. Each scrub should take 5 minutes, and the method must be accomplished firstly of the working session and, if a couple of circumcision is planned, between every operation acne knitwear [url=http://smtkbpccs.edu.in/syslab/purchase-nimegen-no-rx/]discount nimegen 10mg on line[/url]. To discover a medical skilled close by who can talk about info and testing, A listing of medical geneticists could be found at the American College of Medical Geneticists website and genetic counselors can be found on the National Society of Genetic Counselors website. In addition to this ethical perspective, there are different medical and economical elements related to a regularly reported decreased morbidity, more fast restoration and discharge of the patient from hospital. Nineteen patients have been randomized to obstruction and required laparotomy: 2 of them under- bear Gastrografin meal and follow-via study and went bowel resection for strangulation impotence quotes the sun also rises [url=http://smtkbpccs.edu.in/syslab/buy-cheap-kamagra-polo/]buy generic kamagra polo 100 mg on-line[/url]. Tumor cells thereby escape programmed cell dying and replicate infinitely by way of the immortalization course of by telomere lengthening. Hepatotoxicity Only one patient has been reported to have developed hepatitis after nicotinamide alone, and this subject had been given three g day by day followed by 9 g per day for several days (Winter and Boyer, 1973); different subjects who developed liver disease after nicotinamide had also received extended remedy with nicotinic acid (see Rader et al, 1992). Pleomorphic painless tumor lined by regular epithelium of adenoma has no vital sex predilection and redbrown or normal shade, and of elastic consis happens extra typically between forty and 70 years of age antiviral drug cures hiv [url=http://smtkbpccs.edu.in/syslab/buy-mebendazole-no-rx/]generic mebendazole 100 mg with visa[/url].
    Clostridium difficile infections earlier than and through use of ultraviolet disinfection. A comparable retort would be seen if you hear to pick up a coffee gull that you assume trust to to be entire but turns missing to be empty. If the analysis is considered, one can screen for proof of cryptococcal infection by a serum cryptococcal antigen or carry out a lumbar puncture young husband erectile dysfunction [url=http://smtkbpccs.edu.in/syslab/purchase-cheap-tadacip-online-no-rx/]buy tadacip 20 mg mastercard[/url]. Tympanometers used by general clinicians aren’t the same quality as those used in the research setting. A better prophylaxis of this accident is to individualize the ureter by dissection of the retroperitoneum. Global assessment and quality-of-life measures were poorly reported and it was not attainable to hold out statistical evaluation of those end result measures antiviral resistance definition [url=http://smtkbpccs.edu.in/syslab/buy-lagevrio-no-rx/]order lagevrio 200 mg with visa[/url]. The route of an infection is mostly ascending PhysiologicпїЅBactericidal effect of the mucus. The athlete grips the пїЅVпїЅ bar with their arms absolutely prolonged and begins the concentric motion by pulling/reducing the bar to the bottom of the chest at a two depend tempo. Bidani’s Centre for Homoeopathy the vagina and in the mouth of the uterus, or a constrictive pain in the uterus and pressure towards the vagina as if everything were about to fall out, additionally at occasions most keen pains within the small of the back; the flatus is obstructed, inflicting pain, and so forth symptoms 4dp5dt [url=http://smtkbpccs.edu.in/syslab/purchase-online-mentat-ds-syrup-cheap-no-rx/]order mentat ds syrup with a visa[/url]. As this case is an abdomi- can Journal of Forensic Medicine and ventricular rhythms, an infusion noplasty, the cooling nurse could Pathology, 25(four), 327–333. In Italy, there continues to be large variations in caesarean charges, pushed by very large rates within the south of the country. Adopted by kind permission Migraine Association of Ireland the interview with the patient ought to ideally be a collection of open-ended queries relating to headaches virus protection free download [url=http://smtkbpccs.edu.in/syslab/buy-zitroken/]purchase zitroken once a day[/url].
    Availability Procedure Difco Desoxycholate Lactose Agar See applicable references for specifc procedures. The Chemical Examiner to Government the centers of disturbance of primate friction ridge for- certifed that the brown marks on the calendar were mations truly represented the areas of the volar mammalian blood, the inference being that the actual pads. Children (6 to <12 years of age) Xolair is indicated as add-on remedy to improve bronchial asthma management in sufferers with extreme persistent allergic bronchial asthma who have a constructive pores and skin test or in vitro reactivity to a perennial aeroallergen and frequent daytime symptoms or night time-time awakenings and who have had a number of documented extreme asthma exacerbations regardless of every day high-dose inhaled corticosteroids, plus a protracted-acting inhaled beta2- agonist high cholesterol diet chart [url=http://smtkbpccs.edu.in/syslab/buy-cheap-lasuna/]order cheap lasuna line[/url].

Add Comment

Required fields are marked *. Your email address will not be published.