PluginProbe
Fluent Support – Helpdesk & Customer Support Ticket System / 1.4.1
Fluent Support – Helpdesk & Customer Support Ticket System v1.4.1
2.4.0 2.3.2 2.3.1 2.3.0 2.2.1 2.2.0 trunk 1.10.0 1.10.1 1.10.2 1.10.3 1.10.4 1.10.5 1.4.0 1.4.1 1.4.2 1.4.5 1.4.6 1.4.7 1.5.0 1.5.1 1.5.2 1.5.3 1.5.4 1.5.5 All 68 releases
fluent-support / app / Models / Agent.php

Agent.php in Fluent Support – Helpdesk & Customer Support Ticket System 1.4.1, at app/Models/Agent.php

49 lines 944 B
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 namespace FluentSupport\App\Models;
4
5
6 class Agent extends Person
7 {
8 protected static $type = 'agent';
9
10 protected $searchable = [
11 'id',
12 'first_name',
13 'last_name',
14 'email',
15 'address_line_1',
16 'address_line_2',
17 'country'
18 ];
19
20 public static function boot()
21 {
22 static::creating(function ($model) {
23 $model->person_type = static::$type;
24 $model->hash = md5(time().wp_generate_uuid4());
25 });
26
27 static::addGlobalScope(function ($builder) {
28 $builder->where('person_type', 'agent');
29 });
30 }
31
32
33 /**
34 * One2Many: Customer has to many Click Tickets
35 * @return Model Collection
36 */
37 public function tickets()
38 {
39 $foreign_key = self::$type . '_id';
40
41 $class = __NAMESPACE__ . '\Ticket';
42
43 return $this->hasMany(
44 $class, $foreign_key, 'id'
45 );
46 }
47
48 }
49