Getting started
Laravel DWG Converter extracts embedded thumbnails, exports DXF, structural JSON, and image previews, and reads drawing information, layers, and entities.
Requirements
| Requirement | Supported |
|---|---|
| PHP | 8.2 or later |
| Laravel | 12 or 13 |
| CI tested | PHP 8.2 with Laravel 12, and PHP 8.3 to 8.5 with Laravel 12 or 13 |
Laravel 13 requires PHP 8.3 or later. CI tests both the lowest and current dependencies on PHP 8.2 with Laravel 12.
To read just the stored DWG format, you need no external commands. For other operations, see the requirements by operation.
Installation
composer require mattmy/laravel-dwg-converterInstall the external commands required by the operations you use.
Configuration
Commands on PATH work with the default settings. See Configuration to set custom command paths, timeouts, byte limits, or temporary storage.
Quick start
Pass a validated Laravel upload to extract its embedded preview and save it to the default Storage disk.
use Mattmy\DwgConverter\Facades\Dwg;
$thumbnail = Dwg::thumbnail($request->file('drawing'))->extract();
$path = $thumbnail->storeAs(
path: 'drawing-thumbnails',
name: 'floor-plan',
);The package adds the detected extension (bmp, png, or wmf). A DWG without an embedded preview raises thumbnail_not_found. See Extracting thumbnails.
Next steps
- Export DXF, structural JSON, or image previews.
- Read drawing information, layers, or entities.