Skip to content

Commit 2f20222

Browse files
committed
Pull request feedback from Bob
1 parent 0499450 commit 2f20222

File tree

3 files changed

+39
-29
lines changed

3 files changed

+39
-29
lines changed

README.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,12 @@ return [
5050
];
5151
```
5252

53+
Or set via environment variable:
54+
55+
```env
56+
STATAMIC_DETOUR_DRIVER=file
57+
```
58+
5359
#### Eloquent Driver
5460

5561
Store redirects in the database. This is recommended for larger sites with many redirects for better performance.
@@ -60,6 +66,12 @@ return [
6066
];
6167
```
6268

69+
Or set via environment variable:
70+
71+
```env
72+
STATAMIC_DETOUR_DRIVER=eloquent
73+
```
74+
6375
When using the Eloquent driver, run the migrations:
6476

6577
```bash

resources/js/components/Detours.vue

Lines changed: 26 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,38 +1,36 @@
11
<template>
22
<div>
3-
<publish-form :title="''" :action="action" :blueprint="blueprint" :meta="meta" :values="values"
4-
@saved="addItem($event)"></publish-form>
5-
3+
<publish-form :title="''" :action="action" :blueprint="blueprint" :meta="meta" :values="values" @saved="addItem($event)"></publish-form>
64
<table class="min-w-full border border-gray-200">
75
<thead class="bg-gray-50">
8-
<tr>
9-
<th class="px-4 py-3 text-left text-sm font-semibold text-gray-700">{{ __('From') }}</th>
10-
<th class="px-4 py-3 text-left text-sm font-semibold text-gray-700">{{ __('To') }}</th>
11-
<th class="px-4 py-3 text-left text-sm font-semibold text-gray-700">{{ __('Type') }}</th>
12-
<th class="px-4 py-3 text-left text-sm font-semibold text-gray-700">{{ __('Code') }}</th>
13-
<th class="px-4 py-3 text-left text-sm font-semibold text-gray-700">{{ __('Sites') }}</th>
14-
<th class="px-4 py-3 text-right text-sm font-semibold text-gray-700">{{ __('Delete') }}</th>
15-
</tr>
6+
<tr>
7+
<th class="px-4 py-3 text-left text-sm font-semibold text-gray-700">{{ __('From') }}</th>
8+
<th class="px-4 py-3 text-left text-sm font-semibold text-gray-700">{{ __('To') }}</th>
9+
<th class="px-4 py-3 text-left text-sm font-semibold text-gray-700">{{ __('Type') }}</th>
10+
<th class="px-4 py-3 text-left text-sm font-semibold text-gray-700">{{ __('Code') }}</th>
11+
<th class="px-4 py-3 text-left text-sm font-semibold text-gray-700">{{ __('Sites') }}</th>
12+
<th class="px-4 py-3 text-right text-sm font-semibold text-gray-700">{{ __('Delete') }}</th>
13+
</tr>
1614
</thead>
1715
<tbody class="divide-y divide-gray-200">
18-
<tr class="hover:bg-gray-50 text-gray-900" v-for="(item, id) in detours" :key="id">
19-
<td class="px-4 py-3 text-sm">{{ item.from }}</td>
20-
<td class="px-4 py-3 text-sm">{{ item.to }}</td>
21-
<td class="px-4 py-3 text-sm">{{ item.type }}</td>
22-
<td class="px-4 py-3 text-sm font-medium">{{ item.code }}</td>
23-
<td class="px-4 py-3 text-sm space-x-2">
16+
<tr class="hover:bg-gray-50 text-gray-900" v-for="(item, id) in detours" :key="id">
17+
<td class="px-4 py-3 text-sm">{{ item.from }}</td>
18+
<td class="px-4 py-3 text-sm">{{ item.to }}</td>
19+
<td class="px-4 py-3 text-sm">{{ item.type }}</td>
20+
<td class="px-4 py-3 text-sm font-medium">{{ item.code }}</td>
21+
<td class="px-4 py-3 text-sm space-x-2">
2422

25-
<span class="rounded-full bg-green-500 text-white p-2" v-if="item.sites?.length === 0">{{ __('All') }}</span>
26-
<span class="rounded-full bg-green-500 text-white p-2" v-for="site in item.sites" v-else :key="site">{{ site }}</span>
27-
</td>
28-
<td class="px-4 py-3 text-right">
29-
<button
30-
@click="deleteDetour(id)"
31-
class="inline-flex items-center px-3 py-1.5 text-sm font-medium text-white bg-red-500 rounded hover:bg-red-400 focus:outline-none focus:ring-2 focus:ring-red-500">
32-
{{ __('Delete') }}
33-
</button>
34-
</td>
35-
</tr>
23+
<span class="rounded-full bg-green-500 text-white p-2" v-if="item.sites?.length === 0">{{ __('All') }}</span>
24+
<span class="rounded-full bg-green-500 text-white p-2" v-for="site in item.sites" v-else :key="site">{{ site }}</span>
25+
</td>
26+
<td class="px-4 py-3 text-right">
27+
<button
28+
@click="deleteDetour(id)"
29+
class="inline-flex items-center px-3 py-1.5 text-sm font-medium text-white bg-red-500 rounded hover:bg-red-400 focus:outline-none focus:ring-2 focus:ring-red-500">
30+
{{ __('Delete') }}
31+
</button>
32+
</td>
33+
</tr>
3634
</tbody>
3735
</table>
3836
</div>

src/Actions/MatchDetour.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ public function match(string $path): ?Detour
1717
$repository = $this->resolver->resolve();
1818

1919
/** @var Site $site */
20-
$site = SiteFacade::selected();
20+
$site = SiteFacade::current();
2121

2222
$detours = $repository->get();
2323

0 commit comments

Comments
 (0)