yedincisenol / dynamic-links
Firebase Dynamic Links for Php and Laravel
Installs: 357 318
Dependents: 0
Suggesters: 0
Security: 0
Stars: 27
Watchers: 5
Forks: 16
Open Issues: 0
Requires
- php: >=7.0
- ext-curl: *
- guzzlehttp/guzzle: >=6.3
Requires (Dev)
- phpunit/phpunit: 6.*
This package is auto-updated.
Last update: 2024-11-07 12:23:42 UTC
README
Create Firebase Dynamic Links from Php and Laravel
Php Install
composer require "yedincisenol/dynamic-links"
Php Config
$dynamicLink = new yedincisenol\DynamicLinks\DynamicLinks([
'api_key' => 'apiKeyFromFirebaseProject',
'dynamic_link_domain' => 'dynami-domain-from-dynamic-links.goo.gl
]);
Laravel Install
- Add composer
composer require "yedincisenol/dynamic-links"
- Add service provider (For Laravel 5.6 before)
config/app.php
'providers' => [ yedincisenol\DynamicLinks\LaravelServiceProvider::class ],
- Fill Environments
copy theese parameters to your project .env and fill
FIREBASE_API_KEY=
FIREBASE_DYNAMIC_LINKS_DOMAIN=
- Laravel Usage
$link = new yedincisenol\DynamicLinks\DynamicLink('http://yeni.co/');
$shortLink = $dynamicLink->create($link, 'UNGUESSABLE');
- Publish Config file Publish Config for Laravel
php artisan vendor:publish --tag=dynamic-links
Usage
$dynamicLink = new yedincisenol\DynamicLinks\DynamicLinks([ 'api_key' => $apiKey, 'dynamic_link_domain' => $dynamicLinkDomain ]); $link = new yedincisenol\DynamicLinks\DynamicLink('http://yeni.co/'); $shortLink = $dynamicLink->create($link, 'UNGUESSABLE');
Advanced usage: example.php
Test
Run
phpunit