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
Downloads
0
Tags
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
- Remove the old
App\Http\Controllers\API\LinkController,App\Services\DeepLinkService,config/deeplink.php(unless customized), and the manualdeep-links/.well-knownroutes fromroutes/api.phpandroutes/web.php. - Update any imports from
App\Services\DeepLinkServicetoKodeVia\LaravelDeepLink\Services\DeepLinkService(and switchforUserReferral($user)toforReferral($user->id, $user->referral_code)or keepforUserReferral($user)). - If your existing
deep_linkstable already exists, the package migration safely skips creating it.