Skip to content

Commit 8313c15

Browse files
committed
DOCSP-48860: DOCS+ tutorial WIP
1 parent d56aefa commit 8313c15

File tree

2 files changed

+73
-1
lines changed

2 files changed

+73
-1
lines changed
Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
.. _laravel-tutorial-backend-service:
2+
3+
==========================================================
4+
Tutorial: Build a Back End Service by Using {+odm-long+}
5+
==========================================================
6+
7+
.. facet::
8+
:name: genre
9+
:values: tutorial
10+
11+
.. meta::
12+
:keywords: php framework, odm, code example, crud
13+
:description: Learn how to set up a back end and perform CRUD operations by using Laravel MongoDB .
14+
15+
.. contents:: On this page
16+
:local:
17+
:backlinks: none
18+
:depth: 1
19+
:class: singlecol
20+
21+
Overview
22+
--------
23+
24+
In this tutorial, you create a simple REST back end for a front-end app
25+
by using {+odm-long+}. The tutorial uses Laravel's built-in API routing.
26+
27+
Prerequisites
28+
-------------
29+
30+
Before you can start this tutorial, you need the following software
31+
installed in your development environment:
32+
33+
- MongoDB Atlas cluster with sample data loaded. To learn how to create
34+
a cluster, see the :ref:`laravel-quick-start-create-deployment` step
35+
of the Quick Start guide.
36+
- `PHP <https://www.php.net/downloads>`__.
37+
- `Composer <https://getcomposer.org/doc/00-intro.md>`__.
38+
- A terminal app and shell. For MacOS users, use Terminal or a similar app.
39+
For Windows users, use PowerShell.
40+
41+
Steps
42+
-----
43+
44+
.. procedure::
45+
:style: connected
46+
47+
.. step:: Create a Laravel project.
48+
49+
First, create a Laravel project directory. Then, run the following
50+
command to create a new Laravel project called ``laraproject``:
51+
52+
.. code-block:: bash
53+
54+
composer create-project laravel/laravel laraproject
55+
56+
.. step:: Configure your MongoDB connection.
57+
58+
To check that {+odm-long+} is running in the web server,
59+
add a webpage to your Laravel website. In your project,
60+
navigate to ``/routes/web.php`` and add the following route:
61+
62+
.. code-block:: php
63+
64+
Route::get('/info', function () {
65+
phpinfo();
66+
});
67+
68+

docs/quick-start/next-steps.txt

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,11 @@ You can download the web application project by cloning the
2121
`laravel-quickstart <https://github.com/mongodb-university/laravel-quickstart>`__
2222
GitHub repository.
2323

24-
.. tip:: Build a Full Stack Application
24+
.. tip:: Tutorials
25+
26+
Learn how to implement more CRUD functionality in a {+odm-long+}
27+
application by following the :ref:`Build a Back End Service by Using
28+
{+odm-long+} <laravel-tutorial-backend-service>` tutorial.
2529

2630
Learn how to build a full stack application that uses {+odm-long+} by
2731
following along with the `Full Stack Instagram Clone with Laravel and

0 commit comments

Comments
 (0)