Documentation Index
Fetch the complete documentation index at: https://docs.mejik.web.id/llms.txt
Use this file to discover all available pages before exploring further.
English Documentation
Artisan Command: post:process
This command is a unified post-processor for formatting and optimizing various source files. It can read from a local path or a remote URL and write the output to a local path or any configured Laravel filesystem disk (like Amazon S3 or Minio). It acts as a single entry point to run different formatters like Laravel Pint (PHP), Tidy (HTML), Blade Formatter (Blade), and Prettier (JS, TS, Vue, etc.).
1. Prerequisites & Installation
Before using this command, ensure all required tools are installed.a. Laravel Pint (for PHP files)
Pint is included with modern Laravel installations. If missing, install it:b. Tidy CLI (for HTML files)
This is a system command-line tool.- Linux (Ubuntu/Debian):
sudo apt-get install tidy - macOS (Homebrew):
brew install tidy-html5
c. Node.js Tools (for Blade, JS, JSON, TS, & Vue files)
Install the required formatters via npm:2. Usage
The command can process a single file (local or remote) or an entire local directory. Synopsis:Options
| Option | Description | Example |
|---|---|---|
--in= | Required. The input file (local path or URL) or local directory. | --in=resources/js or --in=https://.../app.js |
--out= | Required. The output file or directory path. If --disk is used, this is a path within that disk. | --out=public/dist/js or --out=optimized/app.js |
--filetype= | Required. Supported values: php, blade, html, js, json, ts, vue. | --filetype=vue |
--disk= | Optional. The Laravel filesystem disk to save the output to (e.g., s3, minio). If omitted, output is saved locally. | --disk=s3 |
3. Examples
a. Processing a Remote URL to a Local File
Fetches a file from a URL, formats it, and saves it to the localstorage directory.
b. Processing a Local File to an S3 Bucket
Formats a local JavaScript file and uploads the result to an S3 disk configured inconfig/filesystems.php.
c. Processing a Local Directory to a Minio Bucket
Finds all.blade.php files in a local directory, formats them, and uploads them to a minio disk, preserving the original file structure.
d. Processing a Local Directory to a Local Directory (Standard Use)
This will find all.vue files, format them, and save them to a different local directory.
Dokumentasi Bahasa Indonesia
Perintah Artisan: post:process
Perintah ini adalah post-processor terpadu untuk memformat dan mengoptimalkan berbagai jenis file sumber. Ia dapat membaca dari path lokal atau URL remote dan menulis hasilnya ke path lokal atau disk filesystem Laravel yang terkonfigurasi (seperti Amazon S3 atau Minio). Perintah ini berfungsi sebagai satu pintu masuk untuk menjalankan formatter seperti Laravel Pint (PHP), Tidy (HTML), Blade Formatter (Blade), dan Prettier (JS, TS, Vue, dll.).
1. Prasyarat & Instalasi
Sebelum menggunakan perintah ini, pastikan semua perangkat yang dibutuhkan telah terinstal.a. Laravel Pint (untuk file PHP)
Pint sudah termasuk dalam instalasi Laravel modern. Jika belum ada, instal dengan:b. Tidy CLI (untuk file HTML)
Ini adalah perangkat command-line sistem.- Linux (Ubuntu/Debian):
sudo apt-get install tidy - macOS (Homebrew):
brew install tidy-html5
c. Perangkat Node.js (untuk file Blade, JS, JSON, TS, & Vue)
Instal formatter yang dibutuhkan melalui npm:2. Penggunaan
Perintah ini dapat memproses satu file tunggal (lokal atau remote) atau seluruh direktori lokal. Sinopsis:Opsi
| Opsi | Deskripsi | Contoh |
|---|---|---|
--in= | Wajib. File input (path lokal atau URL) atau direktori lokal. | --in=resources/js atau --in=https://.../app.js |
--out= | Wajib. Path file atau direktori output. Jika --disk digunakan, path ini relatif terhadap disk tersebut. | --out=public/dist/js atau --out=optimized/app.js |
--filetype= | Wajib. Nilai yang didukung: php, blade, html, js, json, ts, vue. | --filetype=vue |
--disk= | Opsional. Disk filesystem Laravel untuk menyimpan output (contoh: s3, minio). Jika dihilangkan, output disimpan secara lokal. | --disk=s3 |
3. Contoh Penggunaan
a. Memproses URL Remote ke File Lokal
Mengambil file dari URL, memformatnya, dan menyimpannya di direktoristorage lokal.
b. Memproses File Lokal ke Bucket S3
Memformat file JavaScript lokal dan mengunggah hasilnya ke disk S3 yang telah dikonfigurasi diconfig/filesystems.php.
c. Memproses Direktori Lokal ke Bucket Minio
Mencari semua file.blade.php di direktori lokal, memformatnya, dan mengunggahnya ke disk minio dengan mempertahankan struktur file aslinya.
d. Memproses Direktori Lokal ke Direktori Lokal (Penggunaan Standar)
Perintah ini akan mencari semua file.vue, memformatnya, dan menyimpannya ke direktori lokal yang berbeda.
