Download the PHP package romansh/laravel-creem-demo without Composer

On this page you can find all versions of the php package romansh/laravel-creem-demo. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package laravel-creem-demo

Laravel Creem Demo

Demo application showcasing romansh/laravel-creem payment integration with Creem.io

✨ Key Features

Built with Laravel 12, Livewire 4, and Tailwind CSS 4.

🖼️ UI Walkthrough (Screenshots)

The screenshots below show the main demo flow and key UI areas.

1) API Setup
Configure API key & webhook secret (masked with eye toggle), webhook URL with copy button, multi-profile tabs, and code example for config/creem.php.
2) Webhooks & Access
Live access log showing GrantAccess / RevokeAccess events, event log with timestamps, event→action mapping table, and AppServiceProvider listener code.
3) Transactions
Browse payment transactions with IDs, amounts, dates, and customer emails. Includes a code example for listing transactions via the Creem facade.
4) Discounts
Create Discount Code dialog — set name, code, pick target products, choose discount type (percentage/fixed), amount, and duration. Validation shown inline.
5) Subscriptions
Recurring plans list with billing periods (monthly, quarterly, bi-annual, annual), prices, and Subscribe buttons. Code example for creating plans and checkout sessions.
6) One-Time Payments
Product list with Preview Product modal showing name, description, price, currency, and tax mode. Create products via API with the code example on the right.

Requirements

Quick Start

Option 1: Composer Create Project (Recommended)

Visit http://localhost:8000/creem-demo and configure your API keys via the web interface!

Option 2: Using Docker (Includes Cloudflare Tunnel)

Visit http://localhost and configure API keys at /creem-demo

Option 3: Manual Installation (Git Clone)

Visit http://localhost:8000/creem-demo

Development Workflow

Using Docker Compose (Recommended)

Starts all services including Cloudflare Tunnel:

Services included:

Access: http://localhost (via Traefik) or your Cloudflare domain

Using PHP Artisan Serve

Traditional Laravel development server:

Access: http://localhost:8000

Configuration

🎯 Creem API Keys - Web Interface (No .env editing!)

The easiest way to get started:

  1. Start the application (any method above)
  2. Visit /
  3. You'll see a configuration form at the top of the page
  4. Get your API credentials from Creem.io Dashboard:
    • API Key - Copy from Settings → Developers
    • Webhook Secret - Copy from Settings → Webhooks
  5. Enter credentials in the web form and click "Save Configuration"
  6. Start testing immediately! 🎉

Important Notes:

Alternative: Pre-fill via .env (Optional)

You can pre-populate the web form by adding to .env (form values override these):

🔌 Webhook Configuration (Local Development)

To receive real-time webhook events from Creem.io on your local machine, you need a public URL. Choose one:

Option 1: Cloudflare Tunnel (Recommended - Auto-configured with Docker)

When using Docker Compose, Cloudflare Tunnel service is already included!

Step 1: Get Cloudflare Tunnel Credentials
  1. Go to Cloudflare Zero Trust Dashboard
  2. Navigate to Networks → Tunnels (or Access → Tunnels)
  3. Click Create a tunnel
  4. Choose tunnel type:
    • Named tunnel (recommended for production) - Persistent, custom domain
    • Quick tunnel (for testing) - Temporary *.trycloudflare.com domain
  5. Follow the setup wizard:
    • Give your tunnel a name (e.g., "creem-demo-local")
    • On the installation page, select Docker as connector
  6. Copy the tunnel token from the docker run command:

  7. Configure tunnel route:
    • Public hostname: Choose subdomain (e.g., creem-demo.yourdomain.com) or use *.trycloudflare.com
    • Service type: HTTP
    • URL: laravel.test:80 (this matches Docker service name)
  8. Save your Tunnel Domain (e.g., creem-demo.yourdomain.com)
Step 2: Add to .env
Step 3: Restart Docker

You should see: "Connection established" or "Registered tunnel connection"

Step 4: Configure Webhook in Creem.io
  1. Go to Creem.io Webhook Settings
  2. Set webhook URL:

  3. Save and test webhook delivery

Option 2: ngrok (For php artisan serve)

If not using Docker, use ngrok for quick public tunneling:

  1. Install ngrok:

  2. Start your Laravel app:

  3. In another terminal, start ngrok:

  4. Copy the forwarding URL from ngrok output:

  5. Configure webhook in Creem.io:
    • Webhook URL: https://abc123.ngrok.io/creem/webhook

Note: Free ngrok URLs change on each restart. For persistent URLs, upgrade to ngrok paid plan.

Database Configuration

Default: SQLite (database/database.sqlite) - created automatically by composer run setup

For MySQL/PostgreSQL, update .env:

Then run migrations:

Development Workflow

Method 1: Using Docker Compose (Production-like Environment)

Docker Compose provides a complete environment with Octane, Traefik, and optional Cloudflare Tunnel:

Services included:

Access:

When to use Docker:

Method 2: Using PHP Artisan Serve (Traditional Development)

Standard Laravel development server - simple and fast for local development:

Or use the combined dev command (runs all services in parallel):

This starts:

Access:

When to use artisan serve:

Webhook Support Summary

Method Webhook Solution Public URL Setup Complexity
Docker Cloudflare Tunnel (built-in) ✅ Persistent custom domain Medium (one-time setup)
artisan serve ngrok ⚠️ Temporary URL (changes each restart) Easy (install + run)

Recommendation: Use Docker if you need reliable webhook testing. Use artisan serve for quick UI/feature development.

Architecture

Module Structure

This demo uses nwidart/laravel-modules for clean, modular architecture:

Routes

Auto-registered after installation:

Method URI Description
GET /creem-demo Main dashboard with config form
GET /creem-demo/success Payment success page
POST /creem/webhook Webhook endpoint for Creem.io

Features Demonstrated

Testing

Run the included test suite:

Troubleshooting

Composer create-project fails

Issue: Package not found on Packagist

Solution: If not yet published to Packagist, clone manually:

Module Not Found

Issue: Module [CreemDemo] not found

Solution:

Livewire Components Not Working

Issue: Livewire components not rendering or updating

Solution:

Cloudflare Tunnel Not Connecting (Docker)

Issue: Tunnel shows as disconnected in dashboard

Solutions:

  1. Verify token is correct:

  2. Check tunnel status:

    Look for: "Connection established" or "Registered tunnel connection"

  3. Verify tunnel configuration in Cloudflare dashboard:

    • Service type: HTTP
    • URL: laravel.test:80 (or http://laravel.test:80)
    • Domain matches CLOUDFLARED_TUNNEL_DOMAIN in .env
  4. Restart tunnel service:

Webhooks Not Received

Issue: Creem.io webhooks not triggering events in the app

Checklist:

  1. Verify webhook URL in Creem.io:

    • Docker: https://your-tunnel-domain.com/creem/webhook
    • Artisan serve + ngrok: https://abc123.ngrok.io/creem/webhook
  2. Test tunnel/ngrok is working:

  3. Test webhook endpoint manually:

  4. Check Laravel logs:

API Errors / Invalid Keys

Issue: API calls return 401/403 errors

Solutions:

  1. Verify using test mode keys:

    • Demo app uses test_mode=true
    • Production API keys will NOT work
    • Get test keys from Creem.io Dashboard
  2. Check API key is saved:

    • Clear browser cache and reload /creem-demo
    • Re-enter API credentials in web form
    • Check browser dev tools → Application → Session Storage
  3. Test API connection:

API/CORS Errors with Custom Host

Issue: API requests fail when using php artisan serve --host=0.0.0.0 or IP addresses

Solution: Always use localhost for local development:

Reason: API providers may reject requests from IP-based URLs due to CORS policies and security restrictions. Use localhost to ensure proper API communication.

Docker Build Issues

Issue: Docker images fail to build

Solution:

Permission Errors (Linux/macOS)

Issue: Permission denied errors on storage/ or bootstrap/cache/

Solution:

What's Next?

After getting the demo running:

  1. Explore the code - Check Modules/CreemDemo/ for implementation examples
  2. Test workflows - Try creating products, checkouts, and subscriptions
  3. Monitor webhooks - Watch real-time events in the dashboard
  4. Integrate into your app - Extract and adapt code for your project
  5. Read the docs - Learn more about the main package

Documentation & Links

Support & Contributing

License

MIT License. See LICENSE for details.

Credits

Created by Roman Shalabanov

Powered by:


All versions of laravel-creem-demo with dependencies

PHP Build Version
Package Version
Requires php Version ^8.2
fakerphp/faker Version ^1.24
laravel/framework Version ^12.0
laravel/octane Version ^2.13
laravel/tinker Version ^2.10.1
nwidart/laravel-modules Version ^12.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package romansh/laravel-creem-demo contains the following files

Loading the files please wait ...