This post is about creating a database connection in laravel.Connecting to database is quite simple and you need not take any pain in the process.So lets start.Before we create a connection to database we need a create so lets first create a database.If you know this step you can skip this process.I will be using CMD to create a database example with table users having fields id auto increment,name varchar,country varchar.
I'm attaching a screen shot of my CMD.Please preview it by clicking on it since it is appearing small.
Ignore the errors which i got while executing the queries :p
Now lets create a connection to this database go to app/config and open database.php.Search for this block of code
I'm attaching a screen shot of my CMD.Please preview it by clicking on it since it is appearing small.
Ignore the errors which i got while executing the queries :p
Now lets create a connection to this database go to app/config and open database.php.Search for this block of code
Change the DB_DATABASE to example,DB_USERNAME to root,DB_PASSWORD to root.(Yours credentials may defer )
Thats all folks and we are done with database connectivity :)
hello ! kiran sadvilkar visit please give me an idea can i buy this gig from fiverr.com Laravelhttps://www.fiverr.com/ahmedwali5990/be-your-laravel-website-expert
ReplyDeleteHi,
ReplyDeleteThank you so much for share your thoughts. I will definitely appreciate your ideas about Laravel Framework Development .
Laravel Development
Aapthi Technologies
Ecommerce Web Development Company
Thanks for sharing such a nice information with us. Very useful lines and to the point.
ReplyDeleteCakePHP Interview Questions Answers
CakePHP Advanced Interview Questions Answers
CakePHP Most Common Interview Questions Answers
Code Igniter Interview Questions Answers
Code Igniter Advanced Interview Questions Answers
Code Igniter Basic Interview Questions Answers
This guidance was really new for me, and I found it genuinely advantageous for myself. I am obliged to you for sharing this piece of guidance here. Keep sharing.
ReplyDeleteWebsite Design Agency | Website design company
Thanks for sharing the informative blog about Database connectivity in Laravel.
ReplyDeleteWeb Designing Company in Coimbatore
Your post on database connection in laravel is very helpful. Thank you for sharing.
ReplyDeleteLaravel Web Development Services