Configuration

Stripe API

Before we begin using Pro Plans, we need to create an account from Stripe (opens in a new tab) to get API keys and secret keys for Cashier.

If you already have an account, you may skip this step. Otherwise, you may register using the button below: After the registration and email verification for your account.

Go to Developers tab and select the API keys page.

stripe dashboard api keys page

Since our account is not activated, we can only use the standard keys.

Under the standard keys section, you can copy the following keys. The publishable key is your API key and the secret key is your secret key.

Now let’s apply these keys to our application.

Open your .env file and edit the following code:

STRIPE_KEY=pk_test_xxxxxxxxxxxxxxxxxxxxxxxxxx STRIPE_SECRET=sk_test_xxxxxxxxxxxxxxxxxxxxxxxxx

Make sure to replace the value with your API key and secret key.

Don’t forget to save the .env file.

Creating a subscription

Now that we have installed website, we can now start creating subscription plans for our users.

Create products with Stripe

Luckily, we can all do this with our Stripe account so login to our Stripe dashboard and navigate to the products page and click the Add Product button.

stripe stripe A form should pop up as soon as you press the add product button.

  • GO to Plans -> Edit Plan
  • Update the Stripe ID, Billing Period and the price to match the values currently set in Stripe. Once you’re done filling up the form, you can save by clicking the Save

Emails

  1. Go to Admin › Settings › SMTP.
  2. Change the Driver field value to SMTP.
  3. Fill in the rest of the fields with the SMTP credentials from your SMTP provider.

Captcha

The Captcha system relies on Google reCAPTCHA's API.

  1. Login into your Google reCAPTCHA (opens in a new tab) account.
  2. Create (opens in a new tab) a new reCAPTCHA v3 Invisible Badge.
  3. Fill all the other fields with the requested information.
  4. Copy the Site key and the Secret key in Admin Settings Captcha.

Google Auth

To work our Google social login we need to create Google App and get the credentials and attach it to our project. But if you have an existing Google app you can skip this, if not then visit this link Google Developers Console then follow the screen below:

laravel socialite

As you can see there is a pop-up box. Just check the Terms of service then click Agree and Continue.

laravel social login with google

Then click the CREATE PROJECT to continue.

laravel 9 socialite with google

Then input your project name and organization (you can set it as No organization) then click CREATE.

NOTE: If you have a project already you can skip the above steps. And just select your current project name created previously.

Now let's click the Credentials after creating the project or the selected project.

laravel socialite

Then click + CREATE CREDENTIALS button.

laravel socialite with google

Then click OAuth client ID.

laravel 9 socialite

Then click the CONFIGURE CONSENT SCREEN.

laravel socialite

It seems they need verification so for now to continue with this tutorial I will click the External because the Internal is not yet available for this account I'm using.

laravel socialite

If your account is new you need to finish the OAuth consent screen and provide the important details they ask for.

Once the consent is finished then we will go back to the Credentials.

laravel socialite

As you can see below there is an option for Application type then you need to select Web application. Then set the name of your project/product name.

Then also set your Authorized Javascript origins and Authorized redirect URIs
Authorized redirect URLs: http://example.com/auth/google/callback
Then click SAVE.

laravel socialite

Then once done it will display a pop-up box for your project credentials.

laravel socialite

Then copy the "Your Client ID" value and "Your Client Secret" value then set up it to Admin › Settings Google.

Facebook Auth

First we need to create Facebook App and get ID and Secret. So, let's follow bellow steps as well:

Step 1: Go to Facebook Developer App to click here: https://developers.facebook.com (opens in a new tab)

Step 2: Then click to "Create App" button 

Step 3: Then Choose consumer

Step 4: Then Add App name as bellow, then after click to create app

Step 5: Now, you will get app id and secret, Then you need to add this details to Admin › Settings Facebook:

Step 6: If you want to upload on production then you need to specify domain as well like this http://example.com/auth/facebook/callback But, if you check with local then you don't need to add this urls: