| Conditions | 5 |
| Paths | 16 |
| Total Lines | 20 |
| Code Lines | 13 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 2 | ||
| Bugs | 0 | Features | 1 |
| 1 | <?php |
||
| 14 | public function details(): Details |
||
| 15 | { |
||
| 16 | // Generic model details |
||
| 17 | // might be able to remove this as id isnt general info |
||
| 18 | $id = Str::slug($this->registration->key().'-'.$this->model->id); |
||
| 19 | $key = $this->registration->key(); |
||
| 20 | $labelSingular = property_exists($this->model, 'labelSingular') ? $this->model->labelSingular : Str::singular($key); |
||
| 21 | $labelPlural = property_exists($this->model, 'labelPlural') ? $this->model->labelPlural : Str::plural($key); |
||
| 22 | $internal_label = contract($this->model, ProvidesFlatReference::class) ? $this->model->flatReferenceLabel() : $key; |
||
| 23 | |||
| 24 | // Manager index and header info |
||
| 25 | $title = $this->model->title ?? ($this->model->id ? $labelSingular . ' ' . $this->model->id : $labelSingular); |
||
| 26 | |||
| 27 | return new Details( |
||
| 28 | $id, |
||
| 29 | $key, |
||
| 30 | $labelSingular.'', |
||
| 31 | $labelPlural.'', |
||
| 32 | $internal_label, |
||
| 33 | $title.'' |
||
| 34 | ); |
||
| 37 |