| @@ 17-39 (lines=23) @@ | ||
| 14 | * |
|
| 15 | * @package RexlManu\LaravelTickets\Models |
|
| 16 | */ |
|
| 17 | class TicketActivity extends Model |
|
| 18 | { |
|
| 19 | use HasConfigModel; |
|
| 20 | ||
| 21 | protected $fillable = [ |
|
| 22 | 'type' |
|
| 23 | ]; |
|
| 24 | ||
| 25 | /** |
|
| 26 | * Gives the ticket that the activity belongs to |
|
| 27 | * |
|
| 28 | * @return \Illuminate\Database\Eloquent\Relations\BelongsTo |
|
| 29 | */ |
|
| 30 | public function ticket() |
|
| 31 | { |
|
| 32 | return $this->belongsTo(Ticket::class, 'ticket_id'); |
|
| 33 | } |
|
| 34 | ||
| 35 | public function getTable() |
|
| 36 | { |
|
| 37 | return config('laravel-tickets.database.ticket-activities-table'); |
|
| 38 | } |
|
| 39 | ||
| 40 | /** |
|
| 41 | * Gives the target, can be ticket, user or message |
|
| 42 | * |
|
| @@ 17-37 (lines=21) @@ | ||
| 14 | * |
|
| 15 | * @package RexlManu\LaravelTickets\Models |
|
| 16 | */ |
|
| 17 | class TicketReference extends Model |
|
| 18 | { |
|
| 19 | ||
| 20 | use HasConfigModel; |
|
| 21 | ||
| 22 | public function getTable() |
|
| 23 | { |
|
| 24 | return config('laravel-tickets.database.ticket-references-table'); |
|
| 25 | } |
|
| 26 | ||
| 27 | /** |
|
| 28 | * Gives the ticket that belongs to it |
|
| 29 | * |
|
| 30 | * @return \Illuminate\Database\Eloquent\Relations\BelongsTo |
|
| 31 | */ |
|
| 32 | public function ticket() |
|
| 33 | { |
|
| 34 | return $this->belongsTo(Ticket::class); |
|
| 35 | } |
|
| 36 | ||
| 37 | /** |
|
| 38 | * Gives the model that is declared as reference |
|
| 39 | * |
|
| 40 | * @return \Illuminate\Database\Eloquent\Relations\MorphTo |
|