Open In App

How to Install MongoDB on Laravel Project?

Last Updated : 28 Nov, 2022
Improve
Improve
Like Article
Like
Save
Share
Report

MongoDB is a cross-platform memorandum database application that is open source. MongoDB, a NoSQL database application, employs documents that resemble JSON and may or may not include schemas. The PHP driver’s high-level encapsulation is the MongoDB PHP Library. The installation procedures for MongoDB on the Laravel project. This article will briefly explain to you How to Install MongoDB on Laravel Project.

Installing MongoDB on Laravel Project

Step 1: Install the repository. Go to your project directory, And then command,

Command-added-in-project-directory

 

Step 2: Next, run the component to install Jenssegers/MongoDB.

Running-components-to-install-mongoDB

 

Step 3: Include the service provider.

Including-service-provider

 

Step 4: Add the following to your service providers list in your config/app.php file.

Step 5: Installing Database setup. The database configuration must then be set in config/database.php. Adding the following code,

Database-setup

 

Step 6: Setting up the.env File. Launch the.env file. Use the following configuration.

Command-to-launch-.env-file

 

Step 7: Swap out all the eloquent.

Command-to-swap-eloquent

 


Like Article
Suggest improvement
Previous
Next
Share your thoughts in the comments

Similar Reads