View .env
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
VITE_SHOPIFY_API_KEY=xxxxxx | |
SHOPIFY_API_KEY=xxxxxxx | |
SHOPIFY_API_SECRET=xxxxxx | |
SHOPIFY_FRONTEND_ENGINE=REACT | |
SHOPIFY_BILLING_ENABLED=true |
View Billable.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace Osiset\ShopifyApp\Http\Middleware; | |
use Closure; | |
use Illuminate\Http\Request; | |
use Illuminate\Support\Facades\Redirect; | |
use Osiset\ShopifyApp\Contracts\Queries\Shop as ShopQuery; | |
use Osiset\ShopifyApp\Contracts\ShopModel as IShopModel; | |
use Osiset\ShopifyApp\Objects\Values\ShopDomain; |
View web.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
use Illuminate\Support\Facades\Route; | |
/* | |
|-------------------------------------------------------------------------- | |
| Web Routes | |
|-------------------------------------------------------------------------- | |
| | |
| Here is where you can register web routes for your application. These |
View welcome.blade.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html lang="{{ str_replace('_', '-', app()->getLocale()) }}"> | |
<head> | |
<meta charset="utf-8"> | |
<meta name="viewport" content="width=device-width, initial-scale=1"> | |
<title>Shopify Laravel Example</title> | |
@viteReactRefresh | |
@vite('resources/js/app.js') | |
</head> | |
<body> |
View app.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import './bootstrap'; | |
import "../css/app.css"; | |
import '../frontend/index.jsx' //import react frontend entry file |
View vite.config.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { defineConfig, loadEnv } from "vite"; | |
import laravel from "laravel-vite-plugin"; | |
import react from "@vitejs/plugin-react"; | |
import fs from "node:fs"; | |
export default defineConfig(function ({ mode }) { | |
process.env = { ...process.env, ...loadEnv(mode, process.cwd()) }; //process.env is not accessible directly in this file so we have to do this | |
return { | |
plugins: [ | |
laravel(["resources/css/app.css", "resources/js/app.js"]), | |
react(), |
View package.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"private": true, | |
"scripts": { | |
"dev": "vite", | |
"build": "vite build" | |
}, | |
"dependencies": { | |
"@shopify/app-bridge": "^3.1.0", | |
"@shopify/app-bridge-react": "^3.1.0", | |
"@shopify/app-bridge-utils": "^3.1.0", |