Skip to content

Commit

Permalink
Merge pull request #5670 from Laravel-Backpack/update-url-column
Browse files Browse the repository at this point in the history
update url column - add rel=noreferrer and fix attribute definition
  • Loading branch information
pxpm committed Sep 19, 2024
2 parents f76027e + 7fa108b commit 9a498cd
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/resources/views/crud/columns/url.blade.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,12 @@
@php
$column['value'] = $column['value'] ?? data_get($entry, $column['name']);
$column['wrapper']['element'] = $column['wrapper']['element'] ?? 'a';
$column['wrapper']['target'] = $column['wrapper']['target'] ?? '_blank';
$column['wrapper']['element'] = $column['wrapper']['element'] ?? $column['element'] ?? 'a';
$column['wrapper']['target'] = $column['wrapper']['target'] ?? $column['target'] ?? '_blank';
$column['wrapper']['href'] = $column['value'];
$rel = $column['wrapper']['rel'] ?? $column['rel'] ?? null;
if($rel !== false) {
$column['wrapper']['rel'] = $rel ?? 'noreferrer';
}
@endphp
@include('crud::columns.text')

0 comments on commit 9a498cd

Please sign in to comment.