|
|
|
@ -1,6 +1,6 @@
|
|
|
|
|
<?php
|
|
|
|
|
|
|
|
|
|
namespace App\Http\Livewire;
|
|
|
|
|
namespace App\Http\Livewire\Table;
|
|
|
|
|
|
|
|
|
|
use App\Helpers\Helper;
|
|
|
|
|
use App\Models\Url;
|
|
|
|
@ -90,21 +90,23 @@ final class AllUlrTable extends PowerGridComponent
|
|
|
|
|
})
|
|
|
|
|
->addColumn('keyword', function (Url $url) {
|
|
|
|
|
return
|
|
|
|
|
'<a href="'.$url->short_url.'" target="_blank" class="font-semibold">'.$url->keyword.'</a>'
|
|
|
|
|
'<a href="'.$url->short_url.'" target="_blank" class="font-light text-indigo-700">'.$url->keyword.'</a>'
|
|
|
|
|
.Blade::render('@svg(\'icon-open-in-new\', \'!h-[0.7em] ml-1\')');
|
|
|
|
|
})
|
|
|
|
|
->addColumn('long_url', function (Url $url) {
|
|
|
|
|
return
|
|
|
|
|
'<span title="'.$url->meta_title.'" class="font-semibold">'
|
|
|
|
|
'<span title="'.$url->meta_title.'">'
|
|
|
|
|
.Str::limit($url->meta_title, 80).
|
|
|
|
|
'</span>
|
|
|
|
|
<br>
|
|
|
|
|
<a href="'.$url->long_url.'" target="_blank" title="'.$url->long_url.'" rel="noopener noreferrer" class="text-slate-500">'
|
|
|
|
|
<a href="'.$url->long_url.'" target="_blank" title="'.$url->long_url.'" rel="noopener noreferrer"
|
|
|
|
|
class="text-slate-500"
|
|
|
|
|
>'
|
|
|
|
|
.Helper::urlDisplay($url->long_url, false, 70)
|
|
|
|
|
.Blade::render('@svg(\'icon-open-in-new\', \'!h-[0.7em] ml-1\')').
|
|
|
|
|
'</a>';
|
|
|
|
|
})
|
|
|
|
|
->addColumn('clicks', fn (Url $url) => $url->clicks.Blade::render('@svg(\'icon-bar-chart\', \'ml-2\')'))
|
|
|
|
|
->addColumn('clicks', fn (Url $url) => $url->clicks.Blade::render('@svg(\'icon-bar-chart\', \'ml-2 text-indigo-600\')'))
|
|
|
|
|
->addColumn('created_at_formatted', function (Url $url) {
|
|
|
|
|
/** @var \Carbon\Carbon */
|
|
|
|
|
$urlCreatedAt = $url->created_at;
|
|
|
|
@ -116,16 +118,24 @@ final class AllUlrTable extends PowerGridComponent
|
|
|
|
|
})
|
|
|
|
|
->addColumn('action', function (Url $url) {
|
|
|
|
|
return
|
|
|
|
|
'<a role="button" href="'.route('short_url.stats', $url->keyword).'" target="_blank" title="'.__('Open front page').'" class="btn-icon btn-action">'
|
|
|
|
|
'<a role="button" href="'.route('short_url.stats', $url->keyword).'" target="_blank" title="'.__('Open front page').'"
|
|
|
|
|
class="btn-icon btn-icon-table"
|
|
|
|
|
>'
|
|
|
|
|
.Blade::render('@svg(\'icon-open-in-new\')').
|
|
|
|
|
'</a>
|
|
|
|
|
<a role="button" href="'.route('dashboard.duplicate', $url->keyword).'" title="'.__('Duplicate').'" class="btn-icon btn-action">'
|
|
|
|
|
<a role="button" href="'.route('dashboard.duplicate', $url->keyword).'" title="'.__('Duplicate').'"
|
|
|
|
|
class="btn-icon btn-icon-table"
|
|
|
|
|
>'
|
|
|
|
|
.Blade::render('@svg(\'icon-clone-alt\')').
|
|
|
|
|
'</a>
|
|
|
|
|
<a role="button" href="'.route('short_url.edit', $url->keyword).'" title="'.__('Edit').'" class="btn-icon btn-action">'
|
|
|
|
|
<a role="button" href="'.route('short_url.edit', $url->keyword).'" title="'.__('Edit').'"
|
|
|
|
|
class="btn-icon btn-icon-table"
|
|
|
|
|
>'
|
|
|
|
|
.Blade::render('@svg(\'icon-edit-alt\')').
|
|
|
|
|
'</a>
|
|
|
|
|
<a role="button" href="'.route('dashboard.delete', $url->getRouteKey()).'" title="'.__('Delete').'" class="btn-icon btn-action-delete">'
|
|
|
|
|
<a role="button" href="'.route('dashboard.delete', $url->getRouteKey()).'" title="'.__('Delete').'"
|
|
|
|
|
class="btn-icon btn-icon-table-delete"
|
|
|
|
|
>'
|
|
|
|
|
.Blade::render('@svg(\'icon-trash-alt\')').
|
|
|
|
|
'</a>';
|
|
|
|
|
});
|