@@ -6,8 +6,8 @@ |
||
6 | 6 | |
7 | 7 | class LiveEngageLaravel extends Facade |
8 | 8 | { |
9 | - protected static function getFacadeAccessor() |
|
10 | - { |
|
11 | - return 'live-engage-laravel'; |
|
12 | - } |
|
9 | + protected static function getFacadeAccessor() |
|
10 | + { |
|
11 | + return 'live-engage-laravel'; |
|
12 | + } |
|
13 | 13 | } |
@@ -6,8 +6,8 @@ |
||
6 | 6 | |
7 | 7 | class Transcript extends Collection |
8 | 8 | { |
9 | - public function __construct(array $models = []) |
|
10 | - { |
|
11 | - return parent::__construct($models); |
|
12 | - } |
|
9 | + public function __construct(array $models = []) |
|
10 | + { |
|
11 | + return parent::__construct($models); |
|
12 | + } |
|
13 | 13 | } |
@@ -4,24 +4,24 @@ |
||
4 | 4 | |
5 | 5 | class ServiceProvider extends \Illuminate\Support\ServiceProvider |
6 | 6 | { |
7 | - const CONFIG_PATH = __DIR__.'/../config/live-engage-laravel.php'; |
|
7 | + const CONFIG_PATH = __DIR__.'/../config/live-engage-laravel.php'; |
|
8 | 8 | |
9 | - public function boot() |
|
10 | - { |
|
11 | - $this->publishes([ |
|
12 | - self::CONFIG_PATH => config_path('live-engage-laravel.php'), |
|
13 | - ], 'config'); |
|
14 | - } |
|
9 | + public function boot() |
|
10 | + { |
|
11 | + $this->publishes([ |
|
12 | + self::CONFIG_PATH => config_path('live-engage-laravel.php'), |
|
13 | + ], 'config'); |
|
14 | + } |
|
15 | 15 | |
16 | - public function register() |
|
17 | - { |
|
18 | - $this->mergeConfigFrom( |
|
19 | - self::CONFIG_PATH, |
|
20 | - 'live-engage-laravel' |
|
21 | - ); |
|
16 | + public function register() |
|
17 | + { |
|
18 | + $this->mergeConfigFrom( |
|
19 | + self::CONFIG_PATH, |
|
20 | + 'live-engage-laravel' |
|
21 | + ); |
|
22 | 22 | |
23 | - $this->app->bind('live-engage-laravel', function () { |
|
24 | - return new LiveEngageLaravel(); |
|
25 | - }); |
|
26 | - } |
|
23 | + $this->app->bind('live-engage-laravel', function () { |
|
24 | + return new LiveEngageLaravel(); |
|
25 | + }); |
|
26 | + } |
|
27 | 27 | } |
@@ -4,7 +4,7 @@ discard block |
||
4 | 4 | |
5 | 5 | class ServiceProvider extends \Illuminate\Support\ServiceProvider |
6 | 6 | { |
7 | - const CONFIG_PATH = __DIR__.'/../config/live-engage-laravel.php'; |
|
7 | + const CONFIG_PATH = __DIR__ . '/../config/live-engage-laravel.php'; |
|
8 | 8 | |
9 | 9 | public function boot() |
10 | 10 | { |
@@ -20,7 +20,7 @@ discard block |
||
20 | 20 | 'live-engage-laravel' |
21 | 21 | ); |
22 | 22 | |
23 | - $this->app->bind('live-engage-laravel', function () { |
|
23 | + $this->app->bind('live-engage-laravel', function() { |
|
24 | 24 | return new LiveEngageLaravel(); |
25 | 25 | }); |
26 | 26 | } |
@@ -6,5 +6,5 @@ |
||
6 | 6 | |
7 | 7 | class MessagingAgent extends Model |
8 | 8 | { |
9 | - protected $guarded = []; |
|
9 | + protected $guarded = []; |
|
10 | 10 | } |
@@ -7,18 +7,18 @@ |
||
7 | 7 | |
8 | 8 | class Engagement extends Model |
9 | 9 | { |
10 | - protected $guarded = []; |
|
11 | - protected $appends = [ |
|
12 | - 'transcript', |
|
13 | - ]; |
|
10 | + protected $guarded = []; |
|
11 | + protected $appends = [ |
|
12 | + 'transcript', |
|
13 | + ]; |
|
14 | 14 | |
15 | - public function getTranscriptAttribute() |
|
16 | - { |
|
17 | - $messages = []; |
|
18 | - foreach ($this->attributes['transcript']->lines as $line) { |
|
19 | - $messages[] = new Message((array) $line); |
|
20 | - } |
|
15 | + public function getTranscriptAttribute() |
|
16 | + { |
|
17 | + $messages = []; |
|
18 | + foreach ($this->attributes['transcript']->lines as $line) { |
|
19 | + $messages[] = new Message((array) $line); |
|
20 | + } |
|
21 | 21 | |
22 | - return new Transcript($messages); |
|
23 | - } |
|
22 | + return new Transcript($messages); |
|
23 | + } |
|
24 | 24 | } |
@@ -7,40 +7,40 @@ |
||
7 | 7 | |
8 | 8 | class Message extends Model |
9 | 9 | { |
10 | - protected $guarded = []; |
|
11 | - |
|
12 | - protected $appends = [ |
|
13 | - 'plaint_text', |
|
14 | - 'time', |
|
15 | - ]; |
|
16 | - |
|
17 | - public function getTextAttribute() |
|
18 | - { |
|
19 | - if ($this->type == 'PLAIN') { |
|
20 | - return $this->messageData->msg->text; |
|
21 | - } elseif ($this->type == 'RICH_CONTENT') { |
|
22 | - return 'RICH_CONTENT'; |
|
23 | - } else { |
|
24 | - return isset($this->attributes['text']) ? $this->attributes['text'] : ''; |
|
25 | - } |
|
26 | - } |
|
27 | - |
|
28 | - public function getPlainTextAttribute() |
|
29 | - { |
|
30 | - return strip_tags($this->text); |
|
31 | - } |
|
32 | - |
|
33 | - public function getTimeAttribute() |
|
34 | - { |
|
35 | - return new Carbon($this->attributes['time']); |
|
36 | - } |
|
37 | - |
|
38 | - public function __toString() |
|
39 | - { |
|
40 | - if ($this->type == 'TEXT_PLAIN') { |
|
41 | - return $this->messageData->msg->text; |
|
42 | - } elseif ($this->type == 'RICH_CONTENT') { |
|
43 | - return 'RICH_CONTENT'; |
|
44 | - } |
|
45 | - } |
|
10 | + protected $guarded = []; |
|
11 | + |
|
12 | + protected $appends = [ |
|
13 | + 'plaint_text', |
|
14 | + 'time', |
|
15 | + ]; |
|
16 | + |
|
17 | + public function getTextAttribute() |
|
18 | + { |
|
19 | + if ($this->type == 'PLAIN') { |
|
20 | + return $this->messageData->msg->text; |
|
21 | + } elseif ($this->type == 'RICH_CONTENT') { |
|
22 | + return 'RICH_CONTENT'; |
|
23 | + } else { |
|
24 | + return isset($this->attributes['text']) ? $this->attributes['text'] : ''; |
|
25 | + } |
|
26 | + } |
|
27 | + |
|
28 | + public function getPlainTextAttribute() |
|
29 | + { |
|
30 | + return strip_tags($this->text); |
|
31 | + } |
|
32 | + |
|
33 | + public function getTimeAttribute() |
|
34 | + { |
|
35 | + return new Carbon($this->attributes['time']); |
|
36 | + } |
|
37 | + |
|
38 | + public function __toString() |
|
39 | + { |
|
40 | + if ($this->type == 'TEXT_PLAIN') { |
|
41 | + return $this->messageData->msg->text; |
|
42 | + } elseif ($this->type == 'RICH_CONTENT') { |
|
43 | + return 'RICH_CONTENT'; |
|
44 | + } |
|
45 | + } |
|
46 | 46 | } |
@@ -6,5 +6,5 @@ |
||
6 | 6 | |
7 | 7 | class Payload extends Model |
8 | 8 | { |
9 | - protected $guarded = []; |
|
9 | + protected $guarded = []; |
|
10 | 10 | } |
@@ -6,5 +6,5 @@ |
||
6 | 6 | |
7 | 7 | class Visitor extends Model |
8 | 8 | { |
9 | - protected $guarded = []; |
|
9 | + protected $guarded = []; |
|
10 | 10 | } |
@@ -6,5 +6,5 @@ |
||
6 | 6 | |
7 | 7 | class Campaign extends Model |
8 | 8 | { |
9 | - protected $guarded = []; |
|
9 | + protected $guarded = []; |
|
10 | 10 | } |