Skip to content

Commit

Permalink
Merge pull request #619 from nasirkhan/dev
Browse files Browse the repository at this point in the history
Public link in Backend Show page
  • Loading branch information
nasirkhan authored Oct 21, 2024
2 parents a21211c + 22c5d8f commit 9a7f210
Show file tree
Hide file tree
Showing 3 changed files with 39 additions and 0 deletions.
10 changes: 10 additions & 0 deletions resources/views/components/backend/buttons/public-view.blade.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
@props(["href" => "", "small" => "true", "text" => "Public View"])
<a
class="btn btn-light {{ $small == "true" ? "btn-sm" : "" }}"
href="{{ $href }}"
target="_blank"
>
<i class="fa-solid fa-arrow-up-right-from-square"></i>
{!! $text != "" ? "&nbsp;" . $text : "" !!}
{!! $slot != "" ? "&nbsp;" . $slot : "" !!}
</a>
20 changes: 20 additions & 0 deletions resources/views/components/backend/buttons/public.blade.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
@props([
"route" => "",
"icon" => "fa-solid fa-arrow-up-right-from-square",
"title",
"small" => "",
"class" => "",
])

@if ($route)
<a
class="btn btn-success {{ $small == "true" ? "btn-sm" : "" }} {{ $class }} ms-1"
data-toggle="tooltip"
href="{{ $route }}"
title="{{ $title }}"
target="_blank"
>
<i class="{{ $icon }} fa-fw"></i>
{!! $slot != "" ? "&nbsp;" . $slot : "" !!}
</a>
@endif
9 changes: 9 additions & 0 deletions resources/views/components/backend/section-header.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,15 @@ class="ms-1"
small="true"
/>
@elseif (Str::endsWith(Route::currentRouteName(), "show"))
@if (Route::has("frontend.$module_name.show"))
<x-backend.buttons.public
class=""
title="{{ __('Public') }}"
route='{!! route("frontend.$module_name.show", encode_id($data->id)) !!}'
small="true"
/>
@endif

@if (auth()->user()->can("edit_" . $module_name) && Route::has("backend." . $module_name . ".edit"))
<x-buttons.edit
class="m-1"
Expand Down

0 comments on commit 9a7f210

Please sign in to comment.