diff --git a/composer.json b/composer.json index 80e4671..93864d8 100644 --- a/composer.json +++ b/composer.json @@ -6,7 +6,9 @@ "license": "MIT", "require": { "php": "^8.1", + "barryvdh/laravel-snappy": "^1.0", "guzzlehttp/guzzle": "^7.2", + "h4cc/wkhtmltopdf-amd64": "^0.12.4", "laravel/framework": "^10.0", "laravel/sanctum": "^3.2", "laravel/tinker": "^2.8" diff --git a/composer.lock b/composer.lock index 82f5e82..ef69955 100644 --- a/composer.lock +++ b/composer.lock @@ -4,8 +4,86 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "98f5f45d28bda1509cdb9a748cad32c4", + "content-hash": "3de53713e3aeb02c39e765cbc0a5c0b1", "packages": [ + { + "name": "barryvdh/laravel-snappy", + "version": "v1.0.2", + "source": { + "type": "git", + "url": "https://github.com/barryvdh/laravel-snappy.git", + "reference": "940eec2d99b89cbc9bea2f493cf068382962a485" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/barryvdh/laravel-snappy/zipball/940eec2d99b89cbc9bea2f493cf068382962a485", + "reference": "940eec2d99b89cbc9bea2f493cf068382962a485", + "shasum": "" + }, + "require": { + "illuminate/filesystem": "^9|^10", + "illuminate/support": "^9|^10", + "knplabs/knp-snappy": "^1.4", + "php": ">=7.2" + }, + "require-dev": { + "orchestra/testbench": "^7|^8" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0-dev" + }, + "laravel": { + "providers": [ + "Barryvdh\\Snappy\\ServiceProvider" + ], + "aliases": { + "PDF": "Barryvdh\\Snappy\\Facades\\SnappyPdf", + "SnappyImage": "Barryvdh\\Snappy\\Facades\\SnappyImage" + } + } + }, + "autoload": { + "psr-4": { + "Barryvdh\\Snappy\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Barry vd. Heuvel", + "email": "barryvdh@gmail.com" + } + ], + "description": "Snappy PDF/Image for Laravel", + "keywords": [ + "image", + "laravel", + "pdf", + "snappy", + "wkhtmltoimage", + "wkhtmltopdf" + ], + "support": { + "issues": "https://github.com/barryvdh/laravel-snappy/issues", + "source": "https://github.com/barryvdh/laravel-snappy/tree/v1.0.2" + }, + "funding": [ + { + "url": "https://fruitcake.nl", + "type": "custom" + }, + { + "url": "https://github.com/barryvdh", + "type": "github" + } + ], + "time": "2023-04-07T10:38:54+00:00" + }, { "name": "brick/math", "version": "0.10.2", @@ -981,6 +1059,129 @@ ], "time": "2021-10-07T12:57:01+00:00" }, + { + "name": "h4cc/wkhtmltopdf-amd64", + "version": "0.12.4", + "source": { + "type": "git", + "url": "https://github.com/h4cc/wkhtmltopdf-amd64.git", + "reference": "4e2ab2d032a5d7fbe2a741de8b10b8989523c95b" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/h4cc/wkhtmltopdf-amd64/zipball/4e2ab2d032a5d7fbe2a741de8b10b8989523c95b", + "reference": "4e2ab2d032a5d7fbe2a741de8b10b8989523c95b", + "shasum": "" + }, + "bin": [ + "bin/wkhtmltopdf-amd64" + ], + "type": "library", + "autoload": { + "psr-4": { + "h4cc\\WKHTMLToPDF\\": "" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "LGPL Version 3" + ], + "authors": [ + { + "name": "Julius Beckmann", + "email": "github@h4cc.de" + } + ], + "description": "Convert html to pdf using webkit (qtwebkit). Static linked linux binary for amd64 systems.", + "homepage": "http://wkhtmltopdf.org/", + "keywords": [ + "binary", + "convert", + "pdf", + "snapshot", + "thumbnail", + "wkhtmltopdf" + ], + "support": { + "issues": "https://github.com/h4cc/wkhtmltopdf-amd64/issues", + "source": "https://github.com/h4cc/wkhtmltopdf-amd64/tree/master" + }, + "time": "2018-01-15T06:57:33+00:00" + }, + { + "name": "knplabs/knp-snappy", + "version": "v1.4.4", + "source": { + "type": "git", + "url": "https://github.com/KnpLabs/snappy.git", + "reference": "3db13fe45d12a7bccb2b83f622e5a90f7e40b111" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/KnpLabs/snappy/zipball/3db13fe45d12a7bccb2b83f622e5a90f7e40b111", + "reference": "3db13fe45d12a7bccb2b83f622e5a90f7e40b111", + "shasum": "" + }, + "require": { + "php": ">=7.1", + "psr/log": "^1.0||^2.0||^3.0", + "symfony/process": "~3.4||~4.3||~5.0||~6.0" + }, + "require-dev": { + "friendsofphp/php-cs-fixer": "^2.16||^3.0", + "pedrotroller/php-cs-custom-fixer": "^2.19", + "phpstan/phpstan": "^1.0.0", + "phpstan/phpstan-phpunit": "^1.0.0", + "phpunit/phpunit": "~7.4||~8.5" + }, + "suggest": { + "h4cc/wkhtmltoimage-amd64": "Provides wkhtmltoimage-amd64 binary for Linux-compatible machines, use version `~0.12` as dependency", + "h4cc/wkhtmltoimage-i386": "Provides wkhtmltoimage-i386 binary for Linux-compatible machines, use version `~0.12` as dependency", + "h4cc/wkhtmltopdf-amd64": "Provides wkhtmltopdf-amd64 binary for Linux-compatible machines, use version `~0.12` as dependency", + "h4cc/wkhtmltopdf-i386": "Provides wkhtmltopdf-i386 binary for Linux-compatible machines, use version `~0.12` as dependency", + "wemersonjanuario/wkhtmltopdf-windows": "Provides wkhtmltopdf executable for Windows, use version `~0.12` as dependency" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.x-dev" + } + }, + "autoload": { + "psr-4": { + "Knp\\Snappy\\": "src/Knp/Snappy" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "KNP Labs Team", + "homepage": "http://knplabs.com" + }, + { + "name": "Symfony Community", + "homepage": "http://github.com/KnpLabs/snappy/contributors" + } + ], + "description": "PHP library allowing thumbnail, snapshot or PDF generation from a url or a html page. Wrapper for wkhtmltopdf/wkhtmltoimage.", + "homepage": "http://github.com/KnpLabs/snappy", + "keywords": [ + "knp", + "knplabs", + "pdf", + "snapshot", + "thumbnail", + "wkhtmltopdf" + ], + "support": { + "issues": "https://github.com/KnpLabs/snappy/issues", + "source": "https://github.com/KnpLabs/snappy/tree/v1.4.4" + }, + "time": "2023-09-13T12:18:19+00:00" + }, { "name": "laravel/framework", "version": "v10.1.5", diff --git a/config/app.php b/config/app.php index 4c9ade5..f5ed9d2 100644 --- a/config/app.php +++ b/config/app.php @@ -195,6 +195,8 @@ return [ App\Providers\EventServiceProvider::class, App\Providers\RouteServiceProvider::class, + // PDF出力 + Barryvdh\Snappy\ServiceProvider::class, ], @@ -211,6 +213,7 @@ return [ 'aliases' => Facade::defaultAliases()->merge([ // 'ExampleClass' => App\Example\ExampleClass::class, + 'SnappyImage' => Barryvdh\Snappy\Facades\SnappyImage::class, ])->toArray(), ]; diff --git a/config/filesystems.php b/config/filesystems.php index e9d9dbd..12660e0 100644 --- a/config/filesystems.php +++ b/config/filesystems.php @@ -39,7 +39,7 @@ return [ 'public' => [ 'driver' => 'local', 'root' => storage_path('app/public'), - 'url' => env('APP_URL').'/storage', + 'url' => env('APP_URL') . '/storage', 'visibility' => 'public', 'throw' => false, ], @@ -73,4 +73,16 @@ return [ public_path('storage') => storage_path('app/public'), ], + /* + |-------------------------------------------------------------------------- + | 一時ファイル設定 + |-------------------------------------------------------------------------- + | + | + */ + + 'tmpFile' => [ + 'lifetime' => env('TMP_FILE_LIFETIME_MIN', 60), // 分 + ] + ]; diff --git a/config/kintone.php b/config/kintone.php index ab72f6f..0b87b03 100644 --- a/config/kintone.php +++ b/config/kintone.php @@ -29,13 +29,16 @@ return [ ...App\Kintone\Models\Customer::setConfig(), ...App\Kintone\Models\Bank::setConfig(), ...App\Kintone\Models\Parking::setConfig(), + ...App\Kintone\Models\ParkingRoom::setConfig(), ...App\Kintone\Models\SeasonTicketContract::setConfig(), ...App\Kintone\Models\SeasonTicketContractPlan::setConfig(), ...App\Kintone\Models\SeasonTicketContractEntry::setConfig(), + ...App\Kintone\Models\SeasonTicketContractReserve::setConfig(), ...App\Kintone\Models\PaymentPlan::setConfig(), ...App\Kintone\Models\GeneralApplication::setConfig(), ...App\Kintone\Models\FAQ::setConfig(), ...App\Kintone\Models\Ask::setConfig(), + ...App\Kintone\Models\Receipt::setConfig(), ], ]; diff --git a/config/snappy.php b/config/snappy.php new file mode 100644 index 0000000..36f8fd1 --- /dev/null +++ b/config/snappy.php @@ -0,0 +1,52 @@ + [ + 'enabled' => true, + 'binary' => env('WKHTML_PDF_BINARY', base_path('vendor/h4cc/wkhtmltopdf-amd64/bin/wkhtmltopdf-amd64')), + 'timeout' => false, + 'options' => [], + 'env' => [], + ], + + 'image' => [ + 'enabled' => true, + 'binary' => env('WKHTML_IMG_BINARY', '/usr/local/bin/wkhtmltoimage'), + 'timeout' => false, + 'options' => [], + 'env' => [], + ], + +];