summaryrefslogtreecommitdiff
path: root/app/Providers/AppServiceProvider.php
blob: 075e8b9f737e4f47ff6424e726411f8e82e0c4b6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
<?php

namespace App\Providers;

use Illuminate\Support\ServiceProvider;
use URL;

class AppServiceProvider extends ServiceProvider
{
    /**
     * Bootstrap any application services.
     *
     * @return void
     */
    public function boot()
    {

	URL::forceScheme('https');

	/*
	* For strftime() in view.
	*/
	setlocale(LC_TIME, 'de_DE.utf8');

	if ( "" != env('MATOMO_LINK_SHORTER_ID') && "" != env('MATOMO_BACKEND_URL') ) {
		$matomo = new \MatomoTracker( env('MATOMO_LINK_SHORTER_ID'), env('MATOMO_BACKEND_URL'));
		if ( "" == session("matomo_id") ) {
			session(["matomo_id" => $matomo->getVisitorId() ]);
		}
	}
    }

    /**
     * Register any application services.
     *
     * @return void
     */
    public function register()
    {
        //
    }
}