Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions app/Models/Prompt/Prompt.php
Original file line number Diff line number Diff line change
Expand Up @@ -289,6 +289,15 @@ public function getUrlAttribute() {
return url('prompts/prompts?name='.$this->name);
}

/**
* Gets the URL of the individual prompt's page, by ID.
*
* @return string
*/
public function getIdUrlAttribute() {
return url('prompts/'.$this->id);
}

/**
* Gets the prompt's asset type for asset management.
*
Expand Down
4 changes: 2 additions & 2 deletions resources/views/prompts/_prompt_entry.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@
<x-admin-edit title="Prompt" :object="$prompt" />
<div class="mb-3">
@if (isset($isPage))
<h1 class="mb-0">{!! $prompt->name !!}</h1>
<h1 class="mb-0">{!! $prompt->name !!} <a href="{{ $prompt->$idUrl }}" class="world-entry-search text-muted"><i class="fas fa-search"></i></a></h1>
@else
<h2 class="mb-0"><a href="{{ url('prompts/' . $prompt->id) }}">{!! $prompt->name !!}</a></h2>
<h2 class="mb-0"><a href="{{ $prompt->$idUrl }}">{!! $prompt->name !!}</a></h2>
@endif
@if ($prompt->prompt_category_id)
<div><strong>Category: </strong>{!! $prompt->category->displayName !!}</div>
Expand Down
Loading