Easily add third-party services to your front-end.
liran-co/laravel-frontend-services is a Laravel package for easily add third-party services to your front-end..
It currently has 2 GitHub stars and 3 downloads on Packagist (latest version v0.1).
Install it with composer require liran-co/laravel-frontend-services.
Discover more Laravel packages by liran-co
or browse all Laravel packages to compare alternatives.
Last updated
⚠️ Warning: This is a pre-release version that is not yet ready for production use.
Laravel Frontend Services exposes Blade Components that make it easier to integrate and include the scripts of third-party services.
To get started, install the liran-co/laravel-frontend-services package:
composer require liran-co/laravel-frontend-services
First, add the relevant configuration values for each service you'd like to use in the config/services.php file.
<?php
return [
// ...
'intercom' => [
'app_id' => env('INTERCOM_APP_ID'),
],
// ...
];
You'll find a full list of supported services below with their corresponding configuration keys.
Next, use Blade component syntax to include the service in your view:
<x-services::intercom />
Typically you'll want to either do this in the <head> section of your site or before the closing </body> tag.
If you'd like to include a service based on some conditional, you can use the show attribute on the component. For example, to only include the Intercom service when a user is logged in, you can do this:
<x-services::intercom show={Auth::check()} />
Since it's common to only include certain scripts in production environments, you can define an environments key in your config file that will automatically cause the service to be included if the current environment matches one in the array:
'intercom' => [
'app_id' => env('INTERCOM_APP_ID'),
'environments' => ['production', 'staging'],
],
Service | Component | Configurations
--- | --- | ---
Facebook | <x-services::facebook /> | app_id
Fullstory | <x-services::fullstory /> | org_id debug
Google Analytics | <x-services::googleanalytics /> | property_id
Heap | <x-services::heap /> | app_id
Intercom | <x-services::intercom /> | app_id
Segment | <x-services::segment /> | write_key
Sentry | <x-services::sentry /> | dsn environment debug
Released under the MIT license. See LICENSE for more information.