@@ -45,18 +45,18 @@ View Sample MongoDB Data
4545
4646 Your ``Movie.php`` file should contain the following code:
4747
48- .. code-block:: php
48+ .. code-block:: php
4949
50- <?php
50+ <?php
5151
52- namespace App\Models;
52+ namespace App\Models;
5353
54- use MongoDB\Laravel\Eloquent\Model;
54+ use MongoDB\Laravel\Eloquent\Model;
5555
56- class Movie extends Model
57- {
58- protected $connection = 'mongodb';
59- }
56+ class Movie extends Model
57+ {
58+ protected $connection = 'mongodb';
59+ }
6060
6161 .. step:: Add a Controller Function
6262
@@ -82,7 +82,7 @@ View Sample MongoDB Data
8282
8383 Open the ``web.php`` file in the ``routes`` directory.
8484 Add an import for the ``MovieController`` and a route called
85- ``browse_movies`` as shown in the following code:
85+ ``browse_movies`` as shown in the following code:
8686
8787 .. code-block:: php
8888
@@ -107,36 +107,36 @@ View Sample MongoDB Data
107107
108108 INFO View [resources/views/browse_movie.blade.php] created successfully.
109109
110- Open the ``browse_movie.blade.php`` view file in the ``resources/views``
111- directory. Replace the contents with the following code:
112-
113- .. code-block:: bash
114-
115- <!DOCTYPE html>
116- <html>
117- <head>
118- <title>Browse Movies</title>
119- </head>
120- <body>
121- <h2>Movies</h2>
122-
123- @forelse ($movies as $movie)
124- <p>
125- Title: {{ $movie->title }}<br>
126- Year: {{ $movie->year }}<br>
127- Runtime: {{ $movie->runtime }}<br>
128- IMDB Rating: {{ $movie->imdb['rating'] }}<br>
129- IMDB Votes: {{ $movie->imdb['votes'] }}<br>
130- Plot: {{ $movie->plot }}<br>
131- </p>
132- @empty
133- <p>No results</p>
134- @endforelse
135-
136- </body>
137- </html>
138-
139- .. step:: Start your Laravel Application
110+ Open the ``browse_movie.blade.php`` view file in the ``resources/views``
111+ directory. Replace the contents with the following code:
112+
113+ .. code-block:: bash
114+
115+ <!DOCTYPE html>
116+ <html>
117+ <head>
118+ <title>Browse Movies</title>
119+ </head>
120+ <body>
121+ <h2>Movies</h2>
122+
123+ @forelse ($movies as $movie)
124+ <p>
125+ Title: {{ $movie->title }}<br>
126+ Year: {{ $movie->year }}<br>
127+ Runtime: {{ $movie->runtime }}<br>
128+ IMDB Rating: {{ $movie->imdb['rating'] }}<br>
129+ IMDB Votes: {{ $movie->imdb['votes'] }}<br>
130+ Plot: {{ $movie->plot }}<br>
131+ </p>
132+ @empty
133+ <p>No results</p>
134+ @endforelse
135+
136+ </body>
137+ </html>
138+
139+ .. step:: Start your Laravel Application
140140
141141 Run the following command from the application root directory
142142 to start your PHP built-in web server:
@@ -154,17 +154,17 @@ View Sample MongoDB Data
154154
155155 Press Ctrl+C to stop the server
156156
157- .. step:: View the Movie Data
157+ .. step:: View the Movie Data
158158
159- Open http://127.0.0.1:8000/browse_movies in your web browser. If it runs
160- successfully, you should see a list of movies and details about each of them.
159+ Open http://127.0.0.1:8000/browse_movies in your web browser. If it runs
160+ successfully, you should see a list of movies and details about each of them.
161161
162- .. tip::
162+ .. tip::
163163
164- You can run the ``php artisan route:list`` command from your application
165- root directory to view a list of available routes.
164+ You can run the ``php artisan route:list`` command from your application
165+ root directory to view a list of available routes.
166166
167- .. include:: /includes/quick-start/troubleshoot.rst
167+ .. include:: /includes/quick-start/troubleshoot.rst
168168
169- .. button:: Next: Write Data
170- :uri: /quick-start/write-data/
169+ .. button:: Next: Write Data
170+ :uri: /quick-start/write-data/
0 commit comments