diff --git a/app/Exports/ProductsExport.php b/app/Exports/ProductsExport.php new file mode 100644 index 0000000..607685a --- /dev/null +++ b/app/Exports/ProductsExport.php @@ -0,0 +1,35 @@ +select('id', 'name', 'sku', 'quantity', 'price'); + if (request()->filled('search')) { + $search = request('search'); + $q->where('name', 'like', "%{$search}%"); + if (request()->filled('sort') && request()->filled('order')) { + $sort = request('sort'); + $order = request('order'); + $q->orderBy($sort, $order); + } + } + return $q; + } + + public function headings(): array + { + return ['ID', '상품명', 'SKU', '수량', '가격']; + } +} diff --git a/app/Http/Controllers/ProductExportController.php b/app/Http/Controllers/ProductExportController.php new file mode 100644 index 0000000..1618fff --- /dev/null +++ b/app/Http/Controllers/ProductExportController.php @@ -0,0 +1,16 @@ +=7.4.0 <8.5.0", + "psr/http-client": "^1.0", + "psr/http-factory": "^1.0", + "psr/simple-cache": "^1.0 || ^2.0 || ^3.0" + }, + "require-dev": { + "dealerdirect/phpcodesniffer-composer-installer": "dev-main", + "dompdf/dompdf": "^1.0 || ^2.0 || ^3.0", + "friendsofphp/php-cs-fixer": "^3.2", + "mitoteam/jpgraph": "^10.3", + "mpdf/mpdf": "^8.1.1", + "phpcompatibility/php-compatibility": "^9.3", + "phpstan/phpstan": "^1.1", + "phpstan/phpstan-phpunit": "^1.0", + "phpunit/phpunit": "^8.5 || ^9.0", + "squizlabs/php_codesniffer": "^3.7", + "tecnickcom/tcpdf": "^6.5" + }, + "suggest": { + "dompdf/dompdf": "Option for rendering PDF with PDF Writer", + "ext-intl": "PHP Internationalization Functions", + "mitoteam/jpgraph": "Option for rendering charts, or including charts with PDF or HTML Writers", + "mpdf/mpdf": "Option for rendering PDF with PDF Writer", + "tecnickcom/tcpdf": "Option for rendering PDF with PDF Writer" + }, + "type": "library", + "autoload": { + "psr-4": { + "PhpOffice\\PhpSpreadsheet\\": "src/PhpSpreadsheet" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Maarten Balliauw", + "homepage": "https://blog.maartenballiauw.be" + }, + { + "name": "Mark Baker", + "homepage": "https://markbakeruk.net" + }, + { + "name": "Franck Lefevre", + "homepage": "https://rootslabs.net" + }, + { + "name": "Erik Tilt" + }, + { + "name": "Adrien Crivelli" + } + ], + "description": "PHPSpreadsheet - Read, Create and Write Spreadsheet documents in PHP - Spreadsheet engine", + "homepage": "https://github.com/PHPOffice/PhpSpreadsheet", + "keywords": [ + "OpenXML", + "excel", + "gnumeric", + "ods", + "php", + "spreadsheet", + "xls", + "xlsx" + ], + "support": { + "issues": "https://github.com/PHPOffice/PhpSpreadsheet/issues", + "source": "https://github.com/PHPOffice/PhpSpreadsheet/tree/1.30.1" + }, + "time": "2025-10-26T16:01:04+00:00" + }, { "name": "phpoption/phpoption", "version": "1.9.4", diff --git a/resources/views/product/list.blade.php b/resources/views/product/list.blade.php index 1a133aa..dcff13e 100644 --- a/resources/views/product/list.blade.php +++ b/resources/views/product/list.blade.php @@ -4,7 +4,7 @@
-