@@ -35,33 +35,30 @@ The usage examples are designed to run operations on a MongoDB deployment that c
35
35
the MongoDB Atlas sample datasets. When you run the example code without this sample data,
36
36
the output might not match.
37
37
38
+ Before You Begin
39
+ ~~~~~~~~~~~~~~~~
40
+
38
41
You can run the usage examples from the Laravel web application and MongoDB Atlas cluster that you
39
42
set up in the :ref:`laravel-quick-start` guide. After completing the Quick Start, ensure that your
40
43
application meets the following requirements:
41
44
42
- - Connects to the ``movies`` collection in the Atlas sample datasets
43
- - Contains the ``MovieController.php`` and ``browse_movies.blade.php`` files
44
-
45
- Then, follow this tutorial to add the usage example code to your Laravel application and view
46
- the expected results.
47
-
48
- .. procedure::
49
- :style: connected
45
+ - Configuration to use an Atlas cluster that contains the sample datasets
46
+ - ``Movie`` model configured to use the MongoDB database
47
+ - ``Movie`` view that lists the results
48
+ - HTTP and API controller endpoints for displaying and storing ``Movie`` data
50
49
51
- .. step:: Add the Controller Code to Your Application
52
-
53
- Copy the example code from the :guilabel:`Controller File Code` tab on the usage example
54
- page and paste it into the ``MovieController.php`` file.
50
+ Run the Examples
51
+ ~~~~~~~~~~~~~~~~
55
52
56
- .. step:: Add the View Code to Your Application
57
-
58
- Copy the example code from the :guilabel:`View File Code` tab on the usage example page and
59
- paste it into the ``browse_movies.blade.php`` file.
53
+ Each Usage Example page features example code in the :guilabel:`Controller File Code` and
54
+ :guilabel:`View File Code` tabs that you can copy and paste into your Laravel application.
60
55
61
- .. step:: Run the Usage Example Code
56
+ Unless otherwise specified, you can add Usage Example sample code to your application by performing
57
+ the following actions:
62
58
63
- To run the example controller code and view the results, follow the instructions on the
64
- usage example page.
59
+ - Add the code from the :guilabel:`Controller File Code` tab to your ``MovieController.php`` file in the
60
+ ``app/Http/Controllers`` directory
61
+ - Add the code from the :guilabel:`View File Code` to your ``browse_movies.blade.php`` file in the
62
+ ``resources/views`` directory.
65
63
66
- After completing these steps, you can see the output described in the **Expected Output** section
67
- of the corresponding usage example.
64
+ Follow the instructions on the Usage Example page to run the code and view the expected output.
0 commit comments