How to Connecting to Database in Laravel ?

Answers were Sorted based on User's Feedback



How to Connecting to Database in Laravel ?..

Answer / surbhi

Configure the database in config/database.php file and create the college database with structure in MySQL.
Database: College
Table: student

Is This Answer Correct ?    0 Yes 0 No

How to Connecting to Database in Laravel ?..

Answer / Dharamveer

To connect to a database in Laravel, you need to configure the database connection details in the `.env` file and define the database connection in the `config/database.php` file. After that, you can use the Eloquent ORM (Object-Relational Mapper) to interact with the database.

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More Laravel PHP Framework Interview Questions

What is mass assignable in laravel?

1 Answers  


How do I use sub-domain routing?

1 Answers  


Do you know what is the latest version of laravel?

1 Answers  


How will you describe bundles in laravel?

1 Answers  


How to use the custom table in laravel model?

1 Answers  


What is database migration. How to create migration via artisan?

1 Answers  


What is the function of die?

1 Answers  


Explain events in laravel?

1 Answers  


List out the plateforms laravel homestead supports?

1 Answers  


What is map function in laravel?

1 Answers  


How to get Retrieving a Cookie in Laravel ?

2 Answers  


Is laravel faster than rails?

1 Answers  


Categories