How to change your default database type in laravel?



How to change your default database type in laravel?..

Answer / Preeti Gupta

In Laravel, you can change the default database connection by modifying the 'default' key in the 'database.php' configuration file located in the 'config' directory. You can specify different types of databases such as MySQL, PostgreSQL, SQLite, etc. Here's an example for changing to SQLite:nn```n'mysql' => [n '', // database namen '', // usernamen '', // passwordn '' // database hostn],nn'sqlite' => [n 'database' => env('DB_DATABASE', database_path('database.sqlite')),n '',n '',n ''n]n```

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More Laravel PHP Framework Interview Questions

What is an api route?

1 Answers  


Explain laravel contracts?

1 Answers  


What is laravel dependency injection?

1 Answers  


What is namespace in php laravel?

1 Answers  


Tell me what are system requirement for laravel 5.0?

1 Answers  


What are the advantages of queue?

1 Answers  


What is a Laravel - Contracts ?

1 Answers  


What is use of middleware in laravel?

1 Answers  


What is a laravel collection?

1 Answers  


Is laravel secure?

1 Answers  


Explain the difference between laravel 4 and laravel 5?

1 Answers  


What is laravel horizon?

1 Answers  


Categories