Skip to content

Commit db971be

Browse files
simonhampclaude
andcommitted
Fix route('login') not defined on paid plugin show page for guests
The plugin-show Blade view used route('login') which doesn't exist. The correct named route is 'customer.login'. This caused a 500 error for unauthenticated users viewing paid plugin pages. Closes #56 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 19c4c7c commit db971be

File tree

2 files changed

+38
-1
lines changed

2 files changed

+38
-1
lines changed

resources/views/plugin-show.blade.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,7 @@ class="shrink-0 self-stretch px-3 text-zinc-400 hover:text-zinc-200"
165165
@auth
166166
Manage your credentials on your <a href="{{ route('customer.purchased-plugins.index') }}" class="font-medium underline hover:no-underline">Purchased Plugins</a> dashboard.
167167
@else
168-
<a href="{{ route('login') }}" class="font-medium underline hover:no-underline">Log in</a> to see your credentials, or find them on your <a href="{{ route('customer.purchased-plugins.index') }}" class="font-medium underline hover:no-underline">Purchased Plugins</a> dashboard.
168+
<a href="{{ route('customer.login') }}" class="font-medium underline hover:no-underline">Log in</a> to see your credentials, or find them on your <a href="{{ route('customer.purchased-plugins.index') }}" class="font-medium underline hover:no-underline">Purchased Plugins</a> dashboard.
169169
@endauth
170170
<a href="{{ url('docs/mobile/3/plugins/using-plugins') }}" class="font-medium underline hover:no-underline">Learn more &rarr;</a>
171171
</p>
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
<?php
2+
3+
namespace Tests\Feature;
4+
5+
use App\Features\ShowPlugins;
6+
use App\Models\Plugin;
7+
use App\Models\PluginPrice;
8+
use Illuminate\Foundation\Testing\RefreshDatabase;
9+
use Laravel\Pennant\Feature;
10+
use Tests\TestCase;
11+
12+
class PluginShowPaidGuestTest extends TestCase
13+
{
14+
use RefreshDatabase;
15+
16+
protected function setUp(): void
17+
{
18+
parent::setUp();
19+
20+
Feature::define(ShowPlugins::class, true);
21+
}
22+
23+
public function test_paid_plugin_show_page_renders_for_guest(): void
24+
{
25+
$plugin = Plugin::factory()->approved()->paid()->create();
26+
27+
PluginPrice::factory()->regular()->create([
28+
'plugin_id' => $plugin->id,
29+
'amount' => 2999,
30+
]);
31+
32+
$this->get(route('plugins.show', $plugin->routeParams()))
33+
->assertStatus(200)
34+
->assertSee('Installing this plugin')
35+
->assertSee('Log in');
36+
}
37+
}

0 commit comments

Comments
 (0)