From 5961e52797f4e347164d5a1cae4274b0d0865a45 Mon Sep 17 00:00:00 2001 From: Annika Backstrom Date: Sun, 26 May 2024 12:55:04 +0100 Subject: [PATCH] Revert "Switch to livewire views" This reverts commit 1fc8f4f80249a79924fd2d51b5b82285128efa9a. --- app/Livewire/Bookmark.php | 16 ---- app/View/Components/Bookmark.php | 28 +++++++ composer.json | 3 +- composer.lock | 78 +------------------ resources/sass/app.scss | 13 ---- resources/sass/components/_bookmark.scss | 12 --- resources/views/bookmarks/index.blade.php | 2 +- resources/views/bookmarks/show.blade.php | 5 +- .../bookmark.blade.php | 7 +- routes/web.php | 8 +- 10 files changed, 35 insertions(+), 137 deletions(-) delete mode 100644 app/Livewire/Bookmark.php create mode 100644 app/View/Components/Bookmark.php rename resources/views/{livewire => components}/bookmark.blade.php (78%) diff --git a/app/Livewire/Bookmark.php b/app/Livewire/Bookmark.php deleted file mode 100644 index f2e9174..0000000 --- a/app/Livewire/Bookmark.php +++ /dev/null @@ -1,16 +0,0 @@ -bookmark = $bookmark; - } -} diff --git a/app/View/Components/Bookmark.php b/app/View/Components/Bookmark.php new file mode 100644 index 0000000..271cea1 --- /dev/null +++ b/app/View/Components/Bookmark.php @@ -0,0 +1,28 @@ +links() }} @foreach ($bookmarks as $bookmark) - + @endforeach {{ $bookmarks->links() }} diff --git a/resources/views/bookmarks/show.blade.php b/resources/views/bookmarks/show.blade.php index 9f86dae..605ec9d 100644 --- a/resources/views/bookmarks/show.blade.php +++ b/resources/views/bookmarks/show.blade.php @@ -1,8 +1,5 @@ @extends('layouts.app') @section('content') -

- ← Back -

- + @endsection diff --git a/resources/views/livewire/bookmark.blade.php b/resources/views/components/bookmark.blade.php similarity index 78% rename from resources/views/livewire/bookmark.blade.php rename to resources/views/components/bookmark.blade.php index 4956fa4..eaa31e4 100644 --- a/resources/views/livewire/bookmark.blade.php +++ b/resources/views/components/bookmark.blade.php @@ -1,10 +1,5 @@
-

- {{ $bookmark->title }} - @action('index') - # - @endaction -

+

{{ $bookmark->title }}

{{ $bookmark->href }}

@if (!empty($bookmark->description))
diff --git a/routes/web.php b/routes/web.php index 7cd0725..668451c 100644 --- a/routes/web.php +++ b/routes/web.php @@ -3,9 +3,5 @@ use App\Http\Controllers\BookmarkController; use Illuminate\Support\Facades\Route; -Route::get( - '/', function () { - return redirect()->action([BookmarkController::class, 'index']); - } -); -Route::resource('bookmarks', BookmarkController::class); +Route::get('/', [BookmarkController::class, 'index']); +Route::resource('bookmarks', BookmarkController::class)->except(['index']);