@@ -16,9 +16,10 @@ View Sample MongoDB Data
1616
1717 .. step:: Create a Sample Model and Controller
1818
19- Create a model called ``Movie`` to access data from the sample ``movies``
20- collection in your MongoDB databse. You can create the model with a
21- corresponding resource controller by running the following command:
19+ Create a model called ``Movie`` to represent data from the sample
20+ ``movies`` collection in your MongoDB database. You can create the
21+ model with a corresponding resource controller by running the
22+ following command:
2223
2324 .. code-block:: bash
2425
@@ -36,13 +37,12 @@ View Sample MongoDB Data
3637
3738 .. step:: Edit the Model to use {+odm-short+}
3839
39- Navigate to the ``app/Models `` directory and open the ``Movie.php `` file.
40- Edit the following information in the file :
40+ Open the ``Movie.php `` model in your ``app/Models `` directory and
41+ make the following edits :
4142
4243 - Replace the ``Illuminate\Database\Eloquent\Model`` import with ``MongoDB\Laravel\Eloquent\Model``
4344 - Specify ``mongodb`` in the ``$connection`` field
4445
45-
4646 Your ``Movie.php`` file should contain the following code:
4747
4848 .. code-block:: php
@@ -55,14 +55,14 @@ View Sample MongoDB Data
5555
5656 class Movie extends Model
5757 {
58- protected $connection = 'mongodb';
58+ protected $connection = 'mongodb';
5959 }
6060
6161 .. step:: Add a Controller Function
6262
63- Navigate to the ``app/Http/Controllers`` directory and open the
64- ``MovieController.php`` file. Replace the ``show()`` function
65- with the following code to retrieve results that match a
63+ Open the ``MovieController.php`` file in your `` app/Http/Controllers``
64+ directory. Replace the ``show()`` function with the
65+ following code to retrieve results that match a
6666 database query and render it in the view:
6767
6868 .. code-block:: php
@@ -80,7 +80,7 @@ View Sample MongoDB Data
8080
8181 .. step:: Add a Web Route
8282
83- Navigate to the ``routes `` directory and open the ``web.php `` file .
83+ Open the ``web.php `` file in the ``routes `` directory .
8484 Add an import for the ``MovieController`` and a route called
8585 ``browse_movies`` as shown in the following code:
8686
@@ -95,8 +95,8 @@ View Sample MongoDB Data
9595
9696 .. step:: Generate a View
9797
98- Navigate to the application root directory and run the following
99- command to create a view that displays movie data:
98+ Run the following command from the application root directory
99+ to create a view that displays movie data:
100100
101101 .. code-block:: bash
102102
@@ -107,9 +107,8 @@ View Sample MongoDB Data
107107
108108 INFO View [resources/views/browse_movie.blade.php] created successfully.
109109
110- Navigate to the ``resources/views`` directory and open the
111- ``browse_movie.blade.php`` file. Replace the contents with the
112- following code:
110+ Open the ``browse_movie.blade.php`` view file in the ``resources/views``
111+ directory. Replace the contents with the following code:
113112
114113 .. code-block:: bash
115114
@@ -139,7 +138,7 @@ View Sample MongoDB Data
139138
140139 .. step:: Start your Laravel Application
141140
142- Navigate to the application root directory and run the following command
141+ Run the following command from the application root directory
143142 to start your PHP built-in web server:
144143
145144 .. code-block:: bash
@@ -158,7 +157,7 @@ View Sample MongoDB Data
158157 .. step:: View the Movie Data
159158
160159 Open http://127.0.0.1:8000/browse_movies in your web browser. If it runs
161- successuflly , you should see a list of movies and details about each of them.
160+ successfully , you should see a list of movies and details about each of them.
162161
163162 .. tip::
164163
0 commit comments