Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
SethSharp committed Nov 26, 2023
1 parent a7ef923 commit 38c398d
Show file tree
Hide file tree
Showing 5 changed files with 119 additions and 7 deletions.
26 changes: 26 additions & 0 deletions app/Http/Controllers/ShowStoreController.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
<?php

namespace App\Http\Controllers;

use Inertia\Inertia;
use Stripe\StripeClient;

class ShowStoreController extends Controller
{
public function __invoke()
{
$stripe = new StripeClient(env('STRIPE_SECRET'));
$items = $stripe->products->all(['limit' => 3]);

foreach ($items->data as $item) {
$item['price'] = $stripe->prices->retrieve(
$item->default_price,
[]
)->unit_amount / 100;
}

return Inertia::render('Store', [
'items' => $items
]);
}
}
1 change: 1 addition & 0 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
"laravel/framework": "^10.10",
"laravel/sanctum": "^3.2",
"laravel/tinker": "^2.8",
"stripe/stripe-php": "^13.4",
"tightenco/ziggy": "^1.0"
},
"require-dev": {
Expand Down
63 changes: 61 additions & 2 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

34 changes: 30 additions & 4 deletions resources/js/Pages/Store.vue
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,44 @@
import { Head } from '@inertiajs/vue3'
import PrimaryLayout from '@/Layouts/PrimaryLayout.vue'
import Section from '@/Components/Section.vue'
defineProps({
items: Object,
})
</script>

<template>
<Head title="Store" />

<PrimaryLayout>
<Section>
<template #header> Coming soon... </template>
<template #header> </template>
<template #content>
Our online store will become available soon, showing off all our in-store frames
where you can easily purchase online and pick up in store. If you are interested in
this send us a message so we know people are interested in a feature like this!
<div v-for="item in items.data">
<div class="bg-white">
<div class="">
<div class="lg:grid lg:grid-cols-2 lg:items-start lg:gap-x-8">
<img :src="item.images[0]" />

<!-- Product info -->
<div class="mt-10 px-4 sm:mt-16 sm:px-0 lg:mt-0">
<h1 class="text-3xl font-bold tracking-tight text-gray-900">{{ item.name }}</h1>

<div class="mt-3">
<h2 class="sr-only">Product information</h2>
<p class="text-3xl tracking-tight text-gray-900">${{ item.price }}</p>
</div>

<div class="mt-6">
<h3 class="sr-only">Description</h3>

<div class="space-y-6 text-base text-gray-700" v-html="item.description" />
</div>
</div>
</div>
</div>
</div>
</div>
</template>
</Section>
</PrimaryLayout>
Expand Down
2 changes: 1 addition & 1 deletion routes/web.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
Route::get('/faq', function () { return Inertia::render('FAQ'); })->name('faq');
Route::get('/contact', function () { return Inertia::render('Find'); })->name('contact');
Route::get('/locator', function () { return Inertia::render('Locator'); })->name('locator');
Route::get('/store', function () { return Inertia::render('Store'); })->name('store');
Route::get('/store', \App\Http\Controllers\ShowStoreController::class)->name('store');

Route::prefix('services')->name('services.')->group(function () {
Route::prefix('framing')->name('framing.')->group(function () {
Expand Down

0 comments on commit 38c398d

Please sign in to comment.