Skip to content

coding-wisely/brew

Repository files navigation

Laravel Brew - Terminal Shop Integration ☕

Latest Version on Packagist GitHub Tests Action Status GitHub Code Style Action Status Total Downloads

Order coffee directly from your Laravel terminal! This package integrates with the Terminal Shop API, allowing developers to order coffee, manage subscriptions, and track orders without leaving their development environment.

Because developers run on coffee ☕

Support us

We invest a lot of resources into creating best in class open source packages. You can support us by buying one of our paid products.

We highly appreciate you sending us a postcard from your hometown, mentioning which of our package(s) you are using. You'll find our address on our contact page. We publish all received postcards on our virtual postcard wall.

Requirements

Installation

You can install the package via composer:

composer require coding-wisely/laravel-brew

Publish the config file:

php artisan vendor:publish --tag="laravel-brew-config"

Add your Terminal Shop API token to your .env file:

TERMINAL_SHOP_TOKEN=your_api_token_here

Configuration

The published config file config/laravel-brew.php contains:

return [
    'token' => env('TERMINAL_SHOP_TOKEN'),
    'sandbox' => env('TERMINAL_SHOP_SANDBOX', false),
    'default_subscription_interval' => 2,
    'cache_ttl' => 300,
];

Usage

List Available Coffee Products

php artisan brew
# or
php artisan brew list

Order Coffee

# Order a specific variant
php artisan brew order --variant=var_XXXXXXXXX --quantity=2

# Order with a subscription
php artisan brew order --variant=var_XXXXXXXXX --subscribe --interval=3

# Order with specific address and card
php artisan brew order --variant=var_XXXXXXXXX --address=shp_XXXXXXXXX --card=crd_XXXXXXXXX

View Shopping Cart

php artisan brew cart

Check Order Status

php artisan brew status

View Profile

php artisan brew profile

Manage Addresses

php artisan brew addresses

Manage Payment Methods

php artisan brew cards

Manage Subscriptions

php artisan brew subscriptions

Get Help

php artisan brew help

Command Options

  • --token= - Your Terminal Shop API token (overrides .env setting)
  • --sandbox - Use sandbox environment for testing
  • --product= - Product ID
  • --variant= - Product variant ID (required for ordering)
  • --quantity= - Quantity to order (default: 1)
  • --subscribe - Subscribe to the product
  • --interval= - Subscription interval in weeks (for weekly subscriptions)
  • --address= - Address ID for shipping
  • --card= - Card ID for payment

Examples

Quick Coffee Order

# List products first
php artisan brew

# Order your favorite variant
php artisan brew order --variant=var_Colombia12oz --quantity=2

Set Up a Coffee Subscription

# Subscribe to coffee every 2 weeks
php artisan brew order --variant=var_Ethiopia12oz --subscribe --interval=2

Use Sandbox Mode for Testing

php artisan brew list --sandbox --token=test_token_123

Testing

composer test

Changelog

Please see CHANGELOG for more information on what has changed recently.

Contributing

Please see CONTRIBUTING for details.

Security Vulnerabilities

Please review our security policy on how to report security vulnerabilities.

Credits

License

The MIT License (MIT). Please see License File for more information.

About

terminal shop package for brew

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Sponsor this project

Packages

No packages published

Languages