Skip to content

Commit 9cb6816

Browse files
committed
Update for Laravel 5.5
1 parent 8ce17f8 commit 9cb6816

File tree

5 files changed

+30
-3
lines changed

5 files changed

+30
-3
lines changed

CHANGELOG.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,16 @@ This project adheres to [Semantic Versioning](http://semver.org/).
1111
(This is already detected in subscription update.)
1212
- Filter any incoming web-hook events that are in test mode.
1313

14+
## [0.7.0] - 31 Aug 2017
15+
### Added
16+
- compatibility with Laravel 5.5.
17+
- auto-detection of package's service provider for automatic installation.
18+
- Console error to warn of missing ENV variable.
19+
20+
### Updated
21+
- README with L5.5 particulars.
22+
- CHANGELOG with new entries.
23+
1424
## [0.5.3] - 4 Apr 2016
1525
### Added
1626
- configuration setting to disable the default-bundled tracking hooks.

README.md

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,8 @@
1212
- PHP 7
1313
- Laravel 5.1 (LTS)
1414
- Laravel 5.3
15-
- Laravel 5.4 (current)
15+
- Laravel 5.4
16+
- Laravel 5.5 (LTS, current)
1617

1718
### Legacy Versions
1819
- [Laravel 5.2](https://github.com/GeneaLabs/laravel-mixpanel/tree/afcf3737412c1aebfa9dd1d7687001f78bdb3956)
@@ -23,6 +24,7 @@
2324
composer require genealabs/laravel-mixpanel
2425
```
2526

27+
**Only if you are running Laravel 5.4 or below:**
2628
Add the service provider entry in `config\app.php`:
2729
```php
2830
GeneaLabs\LaravelMixpanel\Providers\LaravelMixpanelService::class,
@@ -43,7 +45,7 @@ Verify that your auth configuration file `config/auth.php` has the user model
4345
'model' => App\User::class,
4446
```
4547

46-
Lastly, add your Mixpanel API token to your `.env` file:
48+
Lastly, add your Mixpanel token to your `.env` file:
4749
```env
4850
MIXPANEL_TOKEN=xxxxxxxxxxxxxxxxxxxxxx
4951
```
@@ -61,6 +63,10 @@ MIXPANEL_TOKEN=xxxxxxxxxxxxxxxxxxxxxx
6163
times out.
6264

6365
## Upgrade Notes
66+
### Version 0.7.0 for Laravel 5.5
67+
- Remove the service provider from `/config/app.php`. The service provider is now
68+
auto-discovered in Laravel 5.5.
69+
6470
### Page Views
6571
- Page view tracking has been removed in favor of Mixpanels in-built Autotrack functionality, which tracks all page views. To turn it on, visit your Mixpanel dashboard, click *Applications > Autotrack > Web > etc.* and enable Autotracking.
6672

composer.json

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,5 +30,12 @@
3030
"psr-4": {
3131
"GeneaLabs\\LaravelMixpanel\\Tests\\": "tests/"
3232
}
33+
},
34+
"extra": {
35+
"laravel": {
36+
"providers": [
37+
"GeneaLabs\\LaravelMixpanel\\Providers\\LaravelMixpanelService"
38+
]
39+
}
3340
}
3441
}

config/services.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
return [
44
'mixpanel' => [
5-
'token' => env('MIXPANEL_TOKEN', 'add your token to your env file'),
5+
'token' => env('MIXPANEL_TOKEN'),
66
'enable-default-tracking' => true,
77
'consumer' => 'socket',
88
'connect-timeout' => 2,
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,8 @@
11
<script src="{{ asset('genealabs-laravel-mixpanel/js/mixpanel.js') }}"></script>
22
<script>
3+
if ("{{ config('services.mixpanel.token') }}" == "") {
4+
console.error('Mixpanel for Laravel: You must declare the env variable MIXPANEL_TOKEN!');
5+
}
6+
37
mixpanel.init("{{ config('services.mixpanel.token') }}");
48
</script>

0 commit comments

Comments
 (0)