Laravel Oauth 2 Rest API using packages "Passport" and "Resource".
- docker-compose build
- docker-compose up
if Docker build is successfull, then following two containers will be created.
- "laravel_api_app" - Web Application container
- "laravel_api_database_mysql" - MySQL container
Docker container name is "laravel_api_app"
- docker exec -it app_laravel_api chown -R www-data:www-data storage
- docker exec -it app_laravel_api php artisan key:generate
- docker exec -it app_laravel_api composer install
- docker exec -it app_laravel_api php artisan migrate
- docker exec -it app_laravel_api php artisan passport:install
- Use postman to create an "Guest" user by this URL "http://localhost:8002/api/register".
- Post fields are "name", "email", "password" and "c_password".
- If user creation is successful then get the "token" from database of that User.
- docker exec -it laravel_api_database_mysql mysql -u root -p la_database
- docker stop $(docker ps -aq)
- docker rm $(docker ps -aq)
- docker rmi $(docker images -q)