-
-
All branches
+
+
+
+
Settings
+
/
+
Branches
+ @if ($canViewTeam)
+
Team
+ @endif
+ @if ($canManageBranches)
+
Add branch
+ @endif
+
+
+
@forelse ($branches as $branch)
-
+
{{ $branch->name }}
{{ $branch->address ?? 'No address' }} · {{ $branch->departments_count }} department(s)
-
Edit
+
+ @if ($canManageBranches)
+
Edit
+ @endif
+
@empty
-
No branches yet.
+
No branches yet.
@endforelse
-
-
+
+
diff --git a/routes/web.php b/routes/web.php
index 0fe55fa..4895804 100644
--- a/routes/web.php
+++ b/routes/web.php
@@ -158,11 +158,14 @@ Route::middleware(['auth', 'platform.session'])->group(function () {
Route::get('/report-issue', [IssueReportController::class, 'create'])->name('care.issues.create');
Route::post('/report-issue', [IssueReportController::class, 'store'])->name('care.issues.store');
- Route::get('/branches', [BranchController::class, 'index'])->name('care.branches.index');
- Route::get('/branches/create', [BranchController::class, 'create'])->name('care.branches.create');
- Route::post('/branches', [BranchController::class, 'store'])->name('care.branches.store');
- Route::get('/branches/{branch}/edit', [BranchController::class, 'edit'])->name('care.branches.edit');
- Route::put('/branches/{branch}', [BranchController::class, 'update'])->name('care.branches.update');
+ Route::get('/settings/branches', [BranchController::class, 'index'])->name('care.branches.index');
+ Route::get('/settings/branches/create', [BranchController::class, 'create'])->name('care.branches.create');
+ Route::post('/settings/branches', [BranchController::class, 'store'])->name('care.branches.store');
+ Route::get('/settings/branches/{branch}/edit', [BranchController::class, 'edit'])->name('care.branches.edit');
+ Route::put('/settings/branches/{branch}', [BranchController::class, 'update'])->name('care.branches.update');
+
+ Route::redirect('/branches', '/settings/branches');
+ Route::redirect('/branches/create', '/settings/branches/create');
Route::get('/departments', [DepartmentController::class, 'index'])->name('care.departments.index');
Route::get('/departments/create', [DepartmentController::class, 'create'])->name('care.departments.create');
diff --git a/tests/Feature/CareWebTest.php b/tests/Feature/CareWebTest.php
index f0ba781..6432371 100644
--- a/tests/Feature/CareWebTest.php
+++ b/tests/Feature/CareWebTest.php
@@ -131,7 +131,9 @@ class CareWebTest extends TestCase
$this->actingAs($this->user)
->get(route('care.branches.index'))
->assertOk()
- ->assertSee('Main Branch');
+ ->assertSee('All branches')
+ ->assertSee('Main Branch')
+ ->assertSee('Settings');
}
public function test_members_index_loads(): void