Skip to main content

Black Friday 2025! Only until December 1st: coupon FRIDAY25 for 40% off Yearly/Lifetime membership!

Read more here

Vending Machine Laravel API with Filament Adminpanel

A project based on a real Upwork job: Employee Purchase System via Access Card and Self-Service Vending Machines.

Here's the link to the PDF of that Upwork job.

The system consists of two main components: a Laravel API for processing purchases and a Filament admin panel for managing the system.

API Purchase Flow

The system processes purchases through a single API endpoint (/api/purchase) which handles the following flow in the app/Http/Controllers/API/PurchaseController.php Controller:

public function process(PurchaseRequest $request): JsonResponse
{
$data = $request->validated();
$transactionTime = $data['timestamp'] ?? now();
 
return DB::transaction(function () use ($data, $transactionTime) {
// Implementation of the purchase flow...
});
}

On top, it has a lot of validation logic.

  1. Validates the incoming request (card number, machine ID, slot number, product price). Validation is handled by the...

Want to Get Access to GitHub Repository?

Unlock the complete README, installation instructions, code walkthrough, and direct access to clone the repository. Join our premium membership to access all project examples.

Full Source Code
Clone and customize
Documentation
Complete setup guides
All Examples
15 premium projects
Become a Premium Member for $129/year or $29/month

We'd Love Your Feedback

Tell us what you like or what we can improve

Feel free to share anything you like or dislike about this page or the platform in general.