clone project to your computer using
git clone https://github.com/moatazmujahid99/iti_summer_training_project.git
get into project using cd iti_summer_training_project
command.
do the following commands
cp .env.example .env
- go to .env file and make DB_DATABASE=facebook_app
-
- create a database called facebook_app in mysql
php artisan key:generate
php artisan migrate
( dont forget to start apache and MySQL form XAMPP )php artisan serve
after that go to link localhost:8000 and make sure every thing work correctly
now we are at master branch and we need to creat new branch for our task to do this
first we creat new branch using
git branch [branch_name]
ex :git branch api
second we go to this branch using
git checkout [branch_name]
ex :git checkout api
now after finshing our task we need to push our work to our branch
note: we push to our branch not master branch so if any thing go wrong our master wont affected by it
we do this using :
git push origin [branch_name]
Finally after finishing all the tasks and test it well, now we are ready to merge our branch with development branch we do this using :
git checkout development
git merge [branch_name]
first we got to /api/sanctum/token
and create token by providing email and password in url body
second we use this urls to get what we want :
-
/api/users
- return all users
-
/api/users/{id}/posts
- return all posts for specific user
-
/api/posts
- return all posts
-
/api/posts/{id}/comments
- return all comments for specific post