Skip to content

FAQ ​

What is customer portal? ​

With the customer portal, you can provide subscription, billing, and invoicing management to your customers without building it yourself. After you configure and integrate the portal, customers redirect to a co-branded dashboard where they can manage their account based on the functionality you configured.

You can set up customer billing portal for stripe here: https://dashboard.stripe.com/test/settings/billing/portal

If you are using lemonsqueezy refer to this link: https://docs.lemonsqueezy.com/help/online-store/customer-portal

How users can access the customer portal and manage subscriptions? ​

After purchasing the product/subscription, user can access customer portal from billing section in user dashboard. User can manage their subscription, update their payment methods and get their invoice for their purchase by visiting customer portal.

How to enable Two-factor authentication? ​

You can enable two factor auth from profile section in your dashboard. You can also configure methods for two-factor authentication like One-time password, Authenticator apps etc.

How do I take the latest update? ​

The best way to take update in your project is that you set our repo as upstream remote(main branch) in your project.

bash
git remote add upstream https://github.com/your-username/your-repo.git

Take the pull from upstream and resolve the merge conflict if there is any.

WARNING

It is recommended that you always take a back up of your project before you take a pull from upstream.

πŸ”„ How Do I Take the Latest Update? ​

The best way to update your project is by setting our repository as an upstream remote (main branch) in your Git project. This ensures you can easily pull the latest changes from the our repo and keep your project up to date.

πŸ› οΈ Steps to Take the Latest Update ​

  1. Add Upstream Remote: Set the upstream remote to point to our repository:

    bash
    git remote add upstream /url-of-our-repo/
  2. Pull Updates from Upstream: Fetch the latest changes from the upstream repository and merge them into your local project.

  3. Resolve Merge Conflicts (if any): If there are any conflicts, you’ll need to manually resolve the merge conflicts.

⚠️ Backup Recommendation

Before pulling from upstream, it is highly recommended to take a backup of your project. This ensures you can restore your previous state if any issues arise during the update process.

Following these steps will help you safely and efficiently integrate the latest updates into your project! πŸŽ‰

How to set title and description for a page?? ​

To set the title and description for a page, you need to use the named slot.

For example, if you want to set the title and description for the Magic Link page, you can do it like this:

blade
  <!-- Set the page title -->
  <x-slot name="title">
    {{ __('Magic Link') }}
  </x-slot>

  <!-- Set the page description -->
  <x-slot name="description">
    {{ __('Log in securely with our magic link authentication. Experience a smooth and user-friendly login process.') }}
  </x-slot>

Deploying a Laravel Application in a Subfolder ​

Deploying your Laravel application in a subfolder (e.g., your-domain.com/subfolder/) can sometimes lead to unexpected errors due to the different URL structures. If you’re facing issues like those below, this guide provides a potential solution to save you hours of troubleshooting.

Common Errors in Subfolder Deployments ​

When deploying in a subfolder, you might encounter the following issues:

  • Livewire not found under subdirectory
    Check out this Laracasts discussion for more on this problem.

  • File upload over HTTPS fails signature verification
    See the relevant GitHub discussion for more context.

If you’re deploying a Jetship-based Laravel application in a subfolder, the following solution can help address these issues.


Solution: Update AppServiceProvider ​

To handle URL signature verification and route setting in a subfolder deployment, add the following code to your AppServiceProvider.php file. This code defines macros that correctly manage URL signatures and sets custom routes for Livewire scripts.

Full Code Example ​

Here’s the code you need to add to your AppServiceProvider:

php
<?php

namespace App\Providers;

use Illuminate\Support\Facades\Route;
use Illuminate\Support\Facades\URL;
use Illuminate\Support\ServiceProvider;
use Illuminate\Http\Request;
use Illuminate\Support\Str;
use Livewire\Livewire;

class AppServiceProvider extends ServiceProvider
{
  /**
   * Register any application services.
   */
  public function register(): void
  {
    // Macro for signature verification that works with subfolder URLs
    UrlGenerator::macro('alternateHasCorrectSignature', function (Request $request, $absolute = true, array $ignoreQuery = []) {
      $ignoreQuery[] = 'signature';

      // Ensure the base path is applied to the absolute URL
      $absoluteUrl = url($request->path()); // forceRootUrl and forceScheme will apply
      $url = $absolute ? $absoluteUrl : '/' . $request->path();
      
      $queryString = collect(explode('&', (string) $request->server->get('QUERY_STRING')))
          ->reject(fn ($parameter) => in_array(Str::before($parameter, '='), $ignoreQuery))
          ->join('&');
      if (is_array($queryString)) {
        $queryString = explode('&', $queryString)[1];
      }

      $original = rtrim($url . '?' . $queryString, '?');
      $signature = hash_hmac('sha256', $original, config('app.key'));

      return hash_equals($signature, (string) $request->query('signature', ''));
    });

    // Additional validation to ensure the signature hasn't expired
    UrlGenerator::macro('alternateHasValidSignature', function (Request $request, $absolute = true, array $ignoreQuery = []) {
        return URL::alternateHasCorrectSignature($request, $absolute, $ignoreQuery)
            && URL::signatureHasNotExpired($request);
    });

    // Extend the Request class with the custom signature validation macro
    Request::macro('hasValidSignature', function ($absolute = true, array $ignoreQuery = []) {
      return URL::alternateHasValidSignature($this, $absolute, $ignoreQuery);
    });
  }

  /**
   * Bootstrap any application services.
   */
  public function boot(): void
  {
    // Set custom Livewire routes for subfolder deployment
    Livewire::setUpdateRoute(function ($handle) {
      return Route::post('/sub-folder/livewire/update', $handle);
    });

    Livewire::setScriptRoute(function ($handle) {
      return Route::get('/sub-folder/livewire/livewire.js', $handle);
    });
  }
}

Explanation of Key Sections ​

  1. URL Signature Verification
    These custom macros handle the URL signature verification in cases where a subfolder is part of the URL, ensuring the integrity of URL signatures while accounting for the subfolder structure.

  2. Setting Custom Routes for Livewire
    Adjusting Livewire’s script and update routes to include the subfolder path (e.g., /jetship-laravel-boilerplate) helps ensure that Livewire assets are correctly loaded, even when served from a subfolder.


⚠️ Note: Remember to update any hardcoded paths to match your specific subfolder setup. Proper configuration of APP_URL in your .env file is also critical when deploying in subdirectories.

By following these steps, your Laravel application should run smoothly in a subfolder environment. Happy coding! πŸŽ‰