@@ -14,11 +14,11 @@ Write Data to MongoDB
1414.. procedure::
1515 :style: connected
1616
17- .. step:: Create the Function to Insert Data
17+ .. step:: Implement the function to insert data
1818
19- Update the ``store()`` method ``MovieController.php``, located in
20- the ``app/Http/Controllers`` directory to insert request data
21- into the database as shown in the following code:
19+ Replace the ``store()`` method in the ``MovieController.php`` file,
20+ located in the ``app/Http/Controllers`` directory with the following
21+ code:
2222
2323 .. code-block:: php
2424
@@ -30,7 +30,7 @@ Write Data to MongoDB
3030 $movie->save();
3131 }
3232
33- .. step:: Add an API Route that Calls the Controller Function
33+ .. step:: Add an API route that calls the controller function
3434
3535 Import the controller and add an API route that calls the ``store()``
3636 method in the ``routes/api.php`` file:
@@ -46,7 +46,7 @@ Write Data to MongoDB
4646 ]);
4747
4848
49- .. step:: Update the Model Fields
49+ .. step:: Update the model fields
5050
5151 Update the ``Movie`` model in the ``app/Models`` directory to
5252 specify the fields that the ``fill()`` method populates as shown in the
@@ -61,7 +61,7 @@ Write Data to MongoDB
6161 protected $fillable = ['title', 'year', 'runtime', 'imdb', 'plot'];
6262 }
6363
64- .. step:: Post a Request to the API
64+ .. step:: Post a request to the API
6565
6666 Create a file called ``movie.json`` and insert the following data:
6767
@@ -85,7 +85,7 @@ Write Data to MongoDB
8585
8686 curl -H "Content-Type: application/json" --data @movie.json http://localhost:8000/api/movies
8787
88- .. step:: View the Data
88+ .. step:: View the data
8989
9090 Open http://127.0.0.1:8000/browse_movies in your web browser to view
9191 the movie information that you submitted. The inserted movie appears at
0 commit comments