Install the plugin:
- Run
composer require simpleanalytics/laravel-package
Or add repositories in composer.json
"repositories": [
{
"url": "https://github.com/simpleanalytics/laravel-package",
"type": "git"
}
],
and add the package name in require with the branch name after the dev:
"simpleanalytics/laravel-package": "dev-main"
"simpleanalytics/laravel-package": "^1.0"
Include the scripts before your end body tag in your .blade template:
...
@include('LaravelPackage::scripts')
</body>
The defaults are set in config/cors.php. Publish the config to copy the file to your own config:
php artisan vendor:publish --provider="SimpleAnalytics\LaravelPackage\SimpleAnalyticsServiceProvider" --tag="config"
To activate serverside tracking of the api activate track-api in your config file:
'track-api' => true
With version 5.4 or below, you must register your service providers manually in the providers section of the config/app.php configuration file in your laravel project.