1. Go to this page and download the library: Download stitchforge/laravel library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
use StitchForge\Laravel\Facades\StitchForge;
// List semua font yang tersedia
$fonts = StitchForge::fonts()->list();
// Buat font baru
$font = StitchForge::fonts()->create(
key: 'gothic',
name: 'Gothic',
category: 'serif',
description: 'Font gaya gotik untuk desain klasik'
);
// Update font
StitchForge::fonts()->update('font-id', [
'name' => 'Gothic Bold',
'category' => 'bold',
]);
// Hapus font
StitchForge::fonts()->delete('font-id');
use StitchForge\Laravel\Facades\StitchForge;
// List semua template
$templates = StitchForge::templates()->list();
// Buat template baru
$template = StitchForge::templates()->create(
name: 'Wedding Circle',
description: 'Template lingkaran untuk monogram wedding',
elements: [
['type' => 'circle', 'radius' => 100, 'x' => 200, 'y' => 200],
],
textSlots: [
['key' => 'initials', 'label' => 'Initial Name', 'font' => 'script', 'size' => 36],
]
);
// Update template
StitchForge::templates()->update('template-id', [
'name' => 'Wedding Circle v2',
]);
// Hapus template
StitchForge::templates()->delete('template-id');
// Resolve template dengan nilai user
$composed = StitchForge::templates()->resolve('template-id', [
'initials' => 'M & E',
]);
use StitchForge\Laravel\Facades\StitchForge;
// Lihat harga saat ini
$pricing = StitchForge::pricing()->get();
// Returns: ['polyester_per_kg' => 5.00, 'metallic_per_kg' => 8.50, 'rayon_per_kg' => 6.00]
// Update harga
StitchForge::pricing()->update([
'polyester_per_kg' => 5.50,
'metallic_per_kg' => 9.00,
'rayon_per_kg' => 6.50,
]);
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.