-
{{ slice.name }}
-
{{ slice.date_range }}
+
+
+
+
+
{{ slice.name }}
+
{{ slice.date_range }}
+
+ class="mb-1 rounded-lg border border-gray-200 bg-white dark:border-gray-700 dark:bg-gray-900">
Group journal entries together with slices of life.
diff --git a/routes/web.php b/routes/web.php
index de08888ee6d..494321665ef 100644
--- a/routes/web.php
+++ b/routes/web.php
@@ -381,6 +381,9 @@
Route::prefix('{journal}')->middleware(['journal'])->group(function () {
Route::get('', [JournalController::class, 'show'])->name('journal.show');
Route::get('years/{year}', [JournalController::class, 'year'])->name('journal.year');
+ Route::get('edit', [JournalController::class, 'edit'])->name('journal.edit');
+ Route::put('', [JournalController::class, 'update'])->name('journal.update');
+ Route::delete('', [JournalController::class, 'destroy'])->name('journal.destroy');
// posts
Route::get('posts/create', [PostController::class, 'create'])->name('post.create');
diff --git a/tests/Unit/Domains/Vault/ManageJournals/Web/ViewHelpers/JournalEditViewHelperTest.php b/tests/Unit/Domains/Vault/ManageJournals/Web/ViewHelpers/JournalEditViewHelperTest.php
new file mode 100644
index 00000000000..86697a0cc3b
--- /dev/null
+++ b/tests/Unit/Domains/Vault/ManageJournals/Web/ViewHelpers/JournalEditViewHelperTest.php
@@ -0,0 +1,45 @@
+create();
+ $journal = Journal::factory()->create([
+ 'name' => 'My Journal',
+ 'description' => 'My Journal Description',
+ ]);
+ Post::factory()->create([
+ 'journal_id' => $journal->id,
+ 'title' => 'My Post',
+ 'written_at' => '2020-01-01',
+ ]);
+
+ $array = JournalEditViewHelper::data($journal->vault, $journal);
+ $this->assertCount(4, $array);
+ $this->assertEquals(
+ [
+ 'id' => $journal->id,
+ 'name' => 'My Journal',
+ 'description' => 'My Journal Description',
+ 'url' => [
+ 'update' => env('APP_URL').'/vaults/'.$journal->vault->id.'/journals/'.$journal->id,
+ 'back' => env('APP_URL').'/vaults/'.$journal->vault->id.'/journals/'.$journal->id,
+ ],
+ ],
+ $array
+ );
+ }
+}
diff --git a/tests/Unit/Domains/Vault/ManageJournals/Web/ViewHelpers/JournalShowViewHelperTest.php b/tests/Unit/Domains/Vault/ManageJournals/Web/ViewHelpers/JournalShowViewHelperTest.php
index 3ad8c0011a4..38ed88f2faf 100644
--- a/tests/Unit/Domains/Vault/ManageJournals/Web/ViewHelpers/JournalShowViewHelperTest.php
+++ b/tests/Unit/Domains/Vault/ManageJournals/Web/ViewHelpers/JournalShowViewHelperTest.php
@@ -44,6 +44,8 @@ public function it_gets_the_data_needed_for_the_view(): void
);
$this->assertEquals(
[
+ 'edit' => env('APP_URL').'/vaults/'.$journal->vault->id.'/journals/'.$journal->id.'/edit',
+ 'destroy' => env('APP_URL').'/vaults/'.$journal->vault->id.'/journals/'.$journal->id,
'create' => env('APP_URL').'/vaults/'.$journal->vault->id.'/journals/'.$journal->id.'/posts/create',
'slice_index' => env('APP_URL').'/vaults/'.$journal->vault->id.'/journals/'.$journal->id.'/slices',
],