Looking to hire Laravel developers? Try LaraJobs

laravel-deeplink maintained by kodevia

Description
Reusable Laravel package for short deep links, Android App Links (assetlinks.json), iOS Universal Links (apple-app-site-association), and branded store fallbacks.
Last update
2026/12/03 05:36 (dev-main)
License
Links
Downloads
0

Comments
comments powered by Disqus

kodevia/laravel-deeplink

Reusable Laravel package for short deep links, Android App Links (/.well-known/assetlinks.json), iOS Universal Links (/.well-known/apple-app-site-association), and branded store fallback pages.

1. Installation

Private GitHub / GitLab Repository

Add the repository to your Laravel app's composer.json:

{
  "repositories": [
    {
      "type": "vcs",
      "url": "https://github.com/gnishh111/laravel-deeplink.git"
    }
  ]
}

Then install and migrate:

composer require kodevia/laravel-deeplink
php artisan migrate

2. Environment Configuration (.env)

DEEPLINK_APP_NAME="Glister Loyaltiz"
DEEPLINK_SCHEME=glister
DEEPLINK_ROUTE_PREFIX=l
DEEPLINK_API_PREFIX=api/v1/deep-links
DEEPLINK_AUTH_MIDDLEWARE="auth:sanctum,verify.api.token,check.user.approved"

DEEPLINK_ANDROID_PACKAGE=com.glister.loyaltyapp
DEEPLINK_ANDROID_SHA256=2C:53:17:E1:...

DEEPLINK_IOS_APP_STORE_URL=
DEEPLINK_IOS_TEAM_ID=
DEEPLINK_IOS_BUNDLE_ID=com.glister.loyaltyapp
DEEPLINK_FALLBACK_WEB_URL="${APP_URL}"

# Optional fallback page branding
DEEPLINK_PRIMARY_COLOR=#111827
DEEPLINK_ACCENT_COLOR=#2563EB
DEEPLINK_LOGO_URL=

3. CloudPanel / Nginx .well-known Snippet

Ensure Nginx does not block or serve static 404s for .well-known verification files:

location ^~ /.well-known/ {
    try_files $uri $uri/ /index.php?$query_string;
}

4. Usage

use KodeVia\LaravelDeepLink\Services\DeepLinkService;
use KodeVia\LaravelDeepLink\Facades\DeepLink;

// Via dependency injection / container
$referral = app(DeepLinkService::class)->forReferral($user->id, $user->referral_code);
$openUrl  = app(DeepLinkService::class)->forAppOpen($user->id);

// Or via Facade
$referral = DeepLink::forReferral($user->id, $user->referral_code);

5. Optional Publishable Overrides

php artisan vendor:publish --tag=deeplink-config
php artisan vendor:publish --tag=deeplink-views
php artisan vendor:publish --tag=deeplink-migrations

6. Migrating from App-Specific Code

  1. Remove the old App\Http\Controllers\API\LinkController, App\Services\DeepLinkService, config/deeplink.php (unless customized), and the manual deep-links / .well-known routes from routes/api.php and routes/web.php.
  2. Update any imports from App\Services\DeepLinkService to KodeVia\LaravelDeepLink\Services\DeepLinkService (and switch forUserReferral($user) to forReferral($user->id, $user->referral_code) or keep forUserReferral($user)).
  3. If your existing deep_links table already exists, the package migration safely skips creating it.