Add our request()->root() to our debug page, implement Entry::getSortKeyAttribute()

This commit is contained in:
Deon George 2025-03-16 09:03:02 +11:00
parent f667250b2c
commit 93640959db
2 changed files with 9 additions and 4 deletions

View File

@ -133,11 +133,10 @@ class Entry extends Model
* Return a key to use for sorting
*
* @return string
* @todo This should be the DN in reverse order
*/
public function getSortKeyAttribute(): string
{
return $this->getDn();
return collect(explode(',',$this->getDn()))->reverse()->join(',');
}
/* METHODS */

View File

@ -24,7 +24,7 @@
<td>BaseDN(s)</td>
<td>
<table class="table table-sm table-borderless">
@foreach(\App\Classes\LDAP\Server::baseDNs()->sort(function($item) { return $item->sortKey; }) as $item)
@foreach($server->baseDNs()->sort(fn($item)=>$item->sort_key) as $item)
<tr>
<td class="ps-0">{{ $item->getDn() }}</td>
</tr>
@ -36,7 +36,13 @@
<!-- Schema DN -->
<tr>
<td>Schema DN</td>
<td>{{ \App\Classes\LDAP\Server::schemaDN() }}</td>
<td>{{ $server->schemaDN() }}</td>
</tr>
<!-- Schema DN -->
<tr>
<td>Root URL</td>
<td>{{ request()->root() }}</td>
</tr>
</tbody>
</table>