Skip to content

Commit

Permalink
more components and update request validation
Browse files Browse the repository at this point in the history
  • Loading branch information
mortenebak committed Nov 1, 2024
1 parent ab0e6cc commit f7a9a87
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 5 deletions.
5 changes: 3 additions & 2 deletions app/Http/Controllers/Subscriptions/SubscriptionController.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ public function index(Request $request): View

public function store(Request $request)
{
request()->validate($request, [
$request->validate([
'token' => 'required',
'coupon' => [
'nullable',
Expand All @@ -29,7 +29,8 @@ public function store(Request $request)
'plan' => 'required|exists:plans,slug',
]);

$plan = Plan::query()->where('slug', $request->get('plan', 'pro-monthly'))
$plan = Plan::query()
->where('slug', $request->get('plan', 'pro-monthly'))
->first();

try {
Expand Down
2 changes: 1 addition & 1 deletion resources/views/components/container.blade.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<div class="bg-white overflow-hidden shadow-sm sm:rounded-lg border border-stone-200">
<div class="p-6">
<div class="p-6 [&>p]:mb-2">
{{ $slot }}
</div>
</div>
2 changes: 1 addition & 1 deletion resources/views/components/plans/card.blade.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
@props([
'plan' => null,
])
<div class="flex flex-col rounded-xl shadow-lg overflow-hidden">
<div class="flex flex-col rounded-xl border border-stone-200 overflow-hidden">
<div class="px-6 py-8 bg-white sm:p-10 sm:pb-6">
<div>
<h3 class="inline-flex px-4 py-1 rounded-full text-sm font-semibold tracking-wide uppercase bg-indigo-100 text-indigo-600" id="tier-Single">
Expand Down
2 changes: 1 addition & 1 deletion resources/views/subscriptions/plans.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<x-h2>Available Subscriptions Plans</x-h2>
<x-h3>Select a plan to continue</x-h3>

<div class="max-w-md mx-auto space-y-4 lg:max-w-5xl lg:grid lg:grid-cols-2 lg:gap-10 lg:space-y-0">
<div class="max-w-md mx-auto space-y-4 lg:max-w-7xl lg:grid lg:grid-cols-2 lg:gap-6 lg:space-y-0">
@foreach($plans as $plan)
<x-plans.card :plan="$plan" />
@endforeach
Expand Down

0 comments on commit f7a9a87

Please sign in to comment.