| Conditions | 2 |
| Paths | 2 |
| Total Lines | 8 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 9 | public function handle(LaravelTrix $trix, \Closure $next) |
||
| 10 | { |
||
| 11 | $attachments = is_object($trix->model) ? $trix->model->trixAttachments()->pluck('attachment') : '[]'; |
||
| 12 | |||
| 13 | $trix->html .= "<input id='attachment-{$trix->config['id']}' value='{$attachments}' name='attachment-{$trix->loweredModelName}-trixFields[{$trix->config['field']}]' type='hidden'>"; |
||
| 14 | |||
| 15 | return $next($trix); |
||
| 16 | } |
||
| 17 | } |
||
| 18 |