-
Notifications
You must be signed in to change notification settings - Fork 1.4k
DOCSP-48860: DOCS+ tutorial - Laravel MongoDB backend #3386
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: 5.4
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A few comments for your consideration!
php artisan serve | ||
|
||
Navigate to http://127.0.0.1:8000/info to view the PHPinfo page. | ||
Verify that the {+php-extension+} is installed. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Q: Is there a line they should check for in the info page to make sure the PHP extension is installed properly? Could be helpful to include.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Will add
'connections' => [ | ||
'mongodb' => [ | ||
'driver' => 'mongodb', | ||
'dsn' => env('MONGODB_URI'), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
'dsn' => env('MONGODB_URI'), | |
'dsn' => '<mongodb_uri>', |
S: The linked to create a connection string page does not talk about setting the connection string as an environment variable. I would use a generic placeholder here instead to avoid confusion. You can also perhaps include a sentence about saving the uri as an environment variable without explicitly saying how.
``Model`` classes represent rows of tables in relational | ||
databases. In MongoDB, they are documents in the collection. | ||
|
||
Your models can define fillable fields if you want to enforce a |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Your models can define fillable fields if you want to enforce a | |
You can use Eloquent models to define fillable fields if you want to enforce a |
S: Just to remain consistent with using the 'Eloquent models' term since 'models' is kind of vague.
the ``embedsMany()`` and ``embedsOne()`` methods. | ||
|
||
As shown in the preceding step, you can define top-level schema | ||
attributes. However, it is more complicated when using arrays |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
attributes. However, it is more complicated when using arrays | |
attributes. However, it is more complicated to define top level schema attributes for arrays |
S: For present tense and specificity
.. contents:: On this page | ||
:local: | ||
:backlinks: none | ||
:depth: 1 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
:depth: 1 | |
:depth: 2 |
S: To show steps in TOC
|
||
In this tutorial, you learned how to create a back-end service by using | ||
Laravel and MongoDB for a front-end web application. | ||
This tutorial also showed why the document model leads to higher |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This tutorial also showed why the document model leads to higher | |
This tutorial also showed how the document model leads to higher |
S: Or 'explained why'
:github:`laravel-mongodb-tutorial | ||
</mongodb-developer/laravel-mongodb-tutorial/>` repository on GitHub. | ||
|
||
See the :ref:`laravel_fundamentals` guides to learn more about |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See the :ref:`laravel_fundamentals` guides to learn more about | |
See the :ref:`<link to Laravel home page>` guides to learn more about |
S: Maybe direct to the Laravel docs home page instead bc it looks nicer?
https://deploy-preview-192--docs-laravel.netlify.app/
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM w/ a few comments! Let me know if you want another look :)
'mongodb' => [ | ||
'driver' => 'mongodb', | ||
'dsn' => env('MONGODB_URI'), | ||
'database' => '<database name>', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think a placeholder would make more sense, so there is no doubt that the user has to replace the database name. But I'll leave it up to you!
in the preceding code or set the ``MONGODB_URI`` environment variable to | ||
your connection string before you run your application. To learn |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
in the preceding code or set the ``MONGODB_URI`` environment variable to | |
your connection string before you run your application. To learn | |
in the preceding code or set the ``MONGODB_URI`` environment variable to | |
your connection string and remove the placeholder before you run your application. To learn |
S: Just because the code won't work as intended if you leave the placeholder if I'm understanding correctly.
]); | ||
}); | ||
|
||
After inserting the document, you can retrieve it by using the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
After inserting the document, you can retrieve it by using the | |
After you insert the document, you can retrieve it by using the |
S: present tense
|
||
MongoDB provides the Query API for optimized queries. | ||
|
||
You can begin building a query from a ``collection`` object. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can begin building a query from a ``collection`` object. | |
You can build a query by using a ``collection`` object. |
S: present tense, simplicity
$result->getDeletedCount() ]; | ||
}); | ||
|
||
To learn more about performing CRUD operations, see the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To learn more about performing CRUD operations, see the | |
To learn more about how to perform CRUD operations, see the |
S: present tense
.. step:: Use indexes to optimize query performance. | ||
|
||
You can create indexes to support your queries and improve | ||
performance. To learn more about creating indexes |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
performance. To learn more about creating indexes | |
performance. To learn more about how to create indexes |
S: present tense
https://jira.mongodb.org/browse/DOCSP-48860
Moves the How To Build a Laravel + MongoDB Back End Service tutorial into docs.
STAGING
Checklist