Skip to content

Commit 5d240aa

Browse files
committed
Update Readme
1 parent 2947377 commit 5d240aa

File tree

1 file changed

+11
-10
lines changed

1 file changed

+11
-10
lines changed

README.md

+11-10
Original file line numberDiff line numberDiff line change
@@ -93,25 +93,26 @@ The only other step remaining is to register the web-hook with Stripe:
9393
Also, choose "Send me all events" to make sure Laravel Mixpanel can make full use of the Stripe data.
9494

9595
### JavaScript Events & Auto-Track
96-
#### Laravel Elixir
97-
Add the following lines to your `/resources/js/app.js` (or equivalent), and
98-
don't forget to replace `YOUR_MIXPANEL_TOKEN` with your actual token:
99-
```js
100-
require('./../../../public/genealabs-laravel-mixpanel/js/mixpanel.js');
101-
mixpanel.init("YOUR_MIXPANEL_TOKEN");
102-
```
103-
104-
#### Blade Template
96+
#### Blade Template (Recommended)
10597
First publish the necessary assets:
10698
```sh
10799
php artisan mixpanel:publish --assets
108100
```
109101

110-
Then add the following to the head section of your layout template:
102+
Then add the following to the head section of your layout template (already does
103+
the init call for you, using the token from your .env file):
111104
```blade
112105
@include ('genealabs-laravel-mixpanel::partials.mixpanel')
113106
```
114107

108+
#### Laravel Elixir
109+
Add the following lines to your `/resources/js/app.js` (or equivalent), and
110+
don't forget to replace `YOUR_MIXPANEL_TOKEN` with your actual token:
111+
```js
112+
require('./../../../public/genealabs-laravel-mixpanel/js/mixpanel.js');
113+
mixpanel.init("YOUR_MIXPANEL_TOKEN");
114+
```
115+
115116
## Usage
116117
MixPanel is loaded into the IoC as a singleton. This means you don't have to manually call $mixPanel::getInstance() as
117118
described in the MixPanel docs. This is already done for you in the ServiceProvider.

0 commit comments

Comments
 (0)