1 | <?php namespace Arcanedev\LaravelTracker\Models; |
||
32 | class SessionActivity extends AbstractModel implements SessionActivityContract |
||
33 | { |
||
34 | /* ------------------------------------------------------------------------------------------------ |
||
35 | | Properties |
||
36 | | ------------------------------------------------------------------------------------------------ |
||
37 | */ |
||
38 | /** |
||
39 | * The table associated with the model. |
||
40 | * |
||
41 | * @var string |
||
42 | */ |
||
43 | protected $table = 'session_activities'; |
||
44 | |||
45 | /** |
||
46 | * The attributes that are mass assignable. |
||
47 | * |
||
48 | * @var array |
||
49 | */ |
||
50 | protected $fillable = [ |
||
51 | 'session_id', |
||
52 | 'path_id', |
||
53 | 'query_id', |
||
54 | 'referrer_id', |
||
55 | 'method', |
||
56 | 'route_path_id', |
||
57 | 'is_ajax', |
||
58 | 'is_secure', |
||
59 | 'is_json', |
||
60 | 'wants_json', |
||
61 | 'error_id', |
||
62 | ]; |
||
63 | |||
64 | /** |
||
65 | * The attributes that should be cast to native types. |
||
66 | * |
||
67 | * @var array |
||
68 | */ |
||
69 | protected $casts = [ |
||
70 | 'id' => 'integer', |
||
71 | 'session_id' => 'integer', |
||
72 | 'path_id' => 'integer', |
||
73 | 'query_id' => 'integer', |
||
74 | 'referrer_id' => 'integer', |
||
75 | 'route_path_id' => 'integer', |
||
76 | 'is_ajax' => 'boolean', |
||
77 | 'is_secure' => 'boolean', |
||
78 | 'is_json' => 'boolean', |
||
79 | 'wants_json' => 'boolean', |
||
80 | 'error_id' => 'integer', |
||
81 | ]; |
||
82 | |||
83 | /* ------------------------------------------------------------------------------------------------ |
||
84 | | Relationships |
||
85 | | ------------------------------------------------------------------------------------------------ |
||
86 | */ |
||
87 | /** |
||
88 | * Session relationship. |
||
89 | * |
||
90 | * @return \Illuminate\Database\Eloquent\Relations\BelongsTo |
||
91 | */ |
||
92 | public function session() |
||
98 | |||
99 | /** |
||
100 | * Path relationship. |
||
101 | * |
||
102 | * @return \Illuminate\Database\Eloquent\Relations\BelongsTo |
||
103 | */ |
||
104 | public function path() |
||
110 | |||
111 | /** |
||
112 | * Query relationship. |
||
113 | * |
||
114 | * @return \Illuminate\Database\Eloquent\Relations\BelongsTo |
||
115 | */ |
||
116 | public function queryRel() |
||
122 | |||
123 | /** |
||
124 | * Referrer relationship. |
||
125 | * |
||
126 | * @return \Illuminate\Database\Eloquent\Relations\BelongsTo |
||
127 | */ |
||
128 | public function referrer() |
||
134 | |||
135 | /** |
||
136 | * Error relationship. |
||
137 | * |
||
138 | * @return \Illuminate\Database\Eloquent\Relations\BelongsTo |
||
139 | */ |
||
140 | public function error() |
||
146 | |||
147 | /* ------------------------------------------------------------------------------------------------ |
||
148 | | Check Functions |
||
149 | | ------------------------------------------------------------------------------------------------ |
||
150 | */ |
||
151 | /** |
||
152 | * Check if the referer exists. |
||
153 | * |
||
154 | * @return bool |
||
155 | */ |
||
156 | public function hasReferer() |
||
160 | } |
||
161 |