Handles RESTful CRUD endpoints for managing sale templates used in form-building workflows.
// Source: https://github.com/NifrasUsanar/InfoShop | License: MIT | Copyright 2025 Nifras Usanar
// Provided via justclaw.it.com; keep this notice with the code.
<?php
namespace App\Http\Controllers;
use App\Models\SaleTemplate;
use Illuminate\Http\Request;
class SaleTemplateController extends Controller
{
/**
* Display a listing of the resource.
*/
public function index()
{
return response()->json(SaleTemplate::all()->map(function ($template) {
$template->cart_items = json_decode($template->cart_items);
return $template;
}));
}
/**
* Show the form for creating a new resource.
*/
public function create()
{
//
}
/**
* Store a newly created resource in storage.
*/
publi
... (truncated -- full source via MCP)
See the full source, get the GitHub permalink, and search for more like it.
Get a free API key