DB_DATABASE=coderpak_coachingappapi
DB_USERNAME=coderpak_coachingappapi	
DB_PASSWORD=coderpak_coachingappapi	



Dashboard
Admin
Coach
Mobile for client



The bold fields are unique and required
The underlined fields are optional
The italic fields are foreign keys

Coach(coach_id, username, full_name, phone, email, password, bio, intro, profile_picture)

Gym(gym_id, coach id, name, slang, email, phone, gym_address_id)

Gymaddresses(address_id, address_line_1, address_line_2, city_state_zip, country)

In the future, we may need to update database tables i.e. to add more fields





php artisan make:model Coach -mf
php artisan make:model Gym -mf
php artisan make:model GymAddresses -mf


php artisan config:cache
php artisan cache:clear
php artisan route:cache

php artisan route:clear
php artisan view:clear
php artisan cache:clear





php artisan migrate


php artisan db:seed







Seamless Email Integration: Sending Emails with Mailgun in Laravel
https://www.youtube.com/watch?v=nKkUIstbYVg&ab_channel=UnityCoding
	composer require symfony/mailgun-mailer
	composer require symfony/http-client



1. Login to your gmail account e.g. myaccount.google.com
2. Go to Security setting and Enable 2 factor (step) authentication
3. 1. After enabling, Inside the 2 Step Verfication , you can see App passwords option.
4. Put your app name and click CREATE button to get new app password.
5. Finally copy the 16 digit of password and click done. Now use this password instead of email password to send mail via your app.





Error:
    file_put_contents(D:\Codes\htdocs\WordpressAPI\storage\framework/sessions/yWog5X2gHbWFT7u25njFSsC5bDQx9sCbx8EKFY88): failed to open stream: No such file or directory
Solution:
    Go to boostrap folder and delete everything inside cache folder.





The D:\Codes\htdocs\CoachingAppAPI\bootstrap\cache directory must be present and writable.
First make sure bootstrap/cache dir is exist if not create a new one: 
	mkdir -p bootstrap/cache/
Then run:
	 php artisan config:cache





InvalidArgumentException
Please provide a valid cache path.

Try the following: 
create these folders under storage/framework:
	sessions
	views
	cache
Now it should work



php artisan storage:link







{
    "message": "",
    "exception": "Symfony\\Component\\HttpKernel\\Exception\\NotFoundHttpException",
    "file": "/home/coderpak/public_html/coachingappapi.arslanishaq.com/CoachingAppAPI/vendor/laravel/framework/src/Illuminate/Routing/AbstractRouteCollection.php",
    "line": 43,
    "trace": [
        {
        ................
        ...............

Solution: storage link and move it to the home directory along with index.php       
The linked storage folder from the public folder, along with other public folder files:
	storage          this one is linked one, not just normal folder.
	.htaccess
	favicon
	index
	robots
	web










Endpoint: https://coachingappapi.arslanishaq.com/api/verifyCoachEmail
Endpoint: https://coachingappapi.arslanishaq.com/api/verifyVerificationCodeforEmail

Endpoint: https://coachingappapi.arslanishaq.com/api/verifyCoachForgetPassword
Endpoint: https://coachingappapi.arslanishaq.com/api/verifyVerificationCodeforForgetPassword

Endpoint: https://coachingappapi.arslanishaq.com/api/createCoachPassword



Endpoint: https://coachingappapi.arslanishaq.com/api/registerCoach
Endpoint: https://coachingappapi.arslanishaq.com/api/updateCoach











Endpoint: https://coachingappapi.arslanishaq.com/api/addGymAddress
Enter Gym Address API: Enter gym address details to the gym address table
	Post Request
	Params
		address_line_1: String
		address_line_2: String
		city_state_zip: String
		country: String
	Response
		success: Boolean
		address_id: Int

Endpoint: https://coachingappapi.arslanishaq.com/api/updateGymAddress
Update Gym Address API:	Update address details in gym address details
	Post Request
	Params
		address_line_1: String
		address_line_2: String
		city_state_zip: String
		country: String
	Response
		success: Boolean
	Note: Here address_id should be passed in the param


Endpoint: https://coachingappapi.arslanishaq.com/api/checkCoachUsername
Check username API: Check for coach username in the coach table
	Get Request
	Params
		username: String
	Response
		alreadyExists: Boolean


Endpoint: https://coachingappapi.arslanishaq.com/api/verifyCoachEmail
Verify email API: Check if the email already exists or not if not send a 4-digit code to the email address.
	Get Request
	Params
		email: String
	Response
		emailExists: Boolean
		code: Int


Endpoint: https://coachingappapi.arslanishaq.com/api/registerCoach
Register Coach API: Add coach details to the coach table, please use encryption for passwords
	Post Request
	Params
		name: String
		email: String
		phone: String
		password: String
	Response
		success: Boolean
		coach_id: Int
	Note: Here name should be changed to username and also full_name also should be passed in the param


Endpoint: https://coachingappapi.arslanishaq.com/api/updateCoach
Update Coach API: Update coach details to the coach table, all the params will be optional.
	Post Request
	Params
		name: String
		email: String
		phone: String
		bio: String
		intro: Video File
		profile_picture: Image File
	Response
		success: Boolean
		coach_id: Int
	Note: Here coach_id also should be passed in the param


Endpoint: https://coachingappapi.arslanishaq.com/api/updateCoachPassword
Update Coach Password API: Update coach table with the new password, please use encryption for passwords
	Post Request
	Params
		coach_id: Int
		current_password: String
		new_password: String
	Response
		success: Boolean


Endpoint: https://coachingappapi.arslanishaq.com/api/fetchCoachDetails
Fetch Coach Details API: Return data from coach, gym, and gym_address tables
	Get Request
	Params
		coach_id: Int
	Response
		success: Boolean
		coach: Object
		gym: Object
		gym_address: Object


Endpoint: https://coachingappapi.arslanishaq.com/api/addGym
Register Gym API: Add Gym details to the gym table
	Post Request
	Params
		name: String
		slang: String
		email: String
		phone: String
		coach_id: Int
		address_id: Int
	Response
		success: Boolean
		gym_id: Int
	Note: Here address_id of params should be renamed to gym_address_id


Endpoint: https://coachingappapi.arslanishaq.com/api/updateGymDetails
Update Gym Details API:	Update details of the gym in the gym table
	Post Request
	Params
		name: String
		slang: String
		email: String
		phone: String
	Response
		success: Boolean
	Note: Here gym_id also should be passed in the param







