Compare commits

...

2 Commits

4 changed files with 9 additions and 5 deletions

View File

@ -13,7 +13,9 @@ class Bookmark extends Component
* Create a new component instance.
*/
public function __construct(
public ModelsBookmark $bookmark
public ModelsBookmark $bookmark,
public bool $showPermalink = true,
public bool $showEdit = true,
) {
//
}

View File

@ -4,7 +4,7 @@
<p>
<a href="{{ action('BookmarkController@index') }}">&larr; Back</a>
</p>
<x-bookmark :bookmark="$bookmark" />
<x-bookmark :$bookmark :show-permalink="false" />
<p>
<a href="{{ action('BookmarkController@edit', ['bookmark' => $bookmark]) }}">edit</a>
</p>

View File

@ -1,10 +1,12 @@
<div class="bookmark">
<p class="bookmark-title">
{{ $bookmark->title }}
@action('index')
@if ($showPermalink)
<a href="{{ action('BookmarkController@show', $bookmark) }}">#</a>
@endif
@if ($showEdit)
<a href="{{ action('BookmarkController@edit', $bookmark) }}">e</a>
@endaction
@endif
</p>
<p class="bookmark-href"><a href="{{ $bookmark->href }}">{{ $bookmark->href }}</a></p>
@if (!empty($bookmark->description))

View File

@ -6,7 +6,7 @@
</head>
<body>
<div class="container">
<h1>url snail</h1>
<h1><a href="{{ url("/") }}">url snail</a></h1>
@yield('content')
</div>
</body>