diff --git a/composer.json b/composer.json index e32127e4de4c..2576c6b7e190 100644 --- a/composer.json +++ b/composer.json @@ -33,6 +33,7 @@ "predis/predis": "^1.1", "sentry/sentry-laravel": "^1.0", "simshaun/recurr": "^4.0", + "spatie/browsershot": "^3.29", "superbalist/laravel-google-cloud-storage": "^2.2", "webpatser/laravel-countries": "dev-master#75992ad", "wildbit/postmark-php": "^2.6" diff --git a/package.json b/package.json index cf8526881407..7ebc471da596 100644 --- a/package.json +++ b/package.json @@ -1,59 +1,60 @@ { - "private": true, - "scripts": { - "dev": "npm run development", - "development": "cross-env NODE_ENV=development node_modules/webpack/bin/webpack.js --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js", - "watch": "npm run development -- --watch", - "watch-poll": "npm run watch -- --watch-poll", - "hot": "cross-env NODE_ENV=development node_modules/webpack-dev-server/bin/webpack-dev-server.js --inline --hot --config=node_modules/laravel-mix/setup/webpack.config.js", - "prod": "npm run production", - "production": "cross-env NODE_ENV=production node_modules/webpack/bin/webpack.js --no-progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js", - "test": "jest" - }, - "devDependencies": { - "@coreui/coreui": "^2.0.12", - "@coreui/coreui-plugin-chartjs-custom-tooltips": "1.2.0", - "@coreui/icons": "^0.3.0", - "@types/bluebird": "^3.5.25", - "@types/core-js": "^0.9.36", - "@types/jest": "^23.3.9", - "axios": "^0.18", - "babel-preset-stage-2": "^6.24.1", - "bootstrap": "^4.0.0", - "chart.js": "^2.7.3", - "cross-env": "^5.1", - "flag-icon-css": "3.2.0", - "font-awesome": "^4.7", - "jest": "^23.6.0", - "jquery": "^3.2", - "laravel-mix": "^2.0", - "pace-progress": "1.0.2", - "perfect-scrollbar": "1.4.0", - "popper.js": "^1.12", - "simple-line-icons": "2.4.1", - "ts-jest": "^23.10.5", - "vue": "^2.5.17", - "vuetable-2": "^1.7.5" - }, - "dependencies": { - "@types/lodash": "^4.14.118", - "@types/node": "^10.12.10", - "axios-progress-bar": "^1.2.0", - "chalk": "^2.4.2", - "hashids": "^1.2.2", - "laravel-echo": "^1.4.0", - "lodash.get": "^4.4.2", - "quill": "^1.3.6", - "socket.io-client": "^2.1.1", - "ts-loader": "3.5.0", - "typescript": "^3.1.6", - "vue-affix": "^0.4.0", - "vue-chartjs": "^3.4.0", - "vue-events": "^3.1.0", - "vue-multiselect": "^2.1.3", - "vue-scrollactive": "^0.8.0", - "vue-select": "^2.5.1", - "vue-toastr": "^2.0.16", - "vuex": "^3.1.0" - } + "private": true, + "scripts": { + "dev": "npm run development", + "development": "cross-env NODE_ENV=development node_modules/webpack/bin/webpack.js --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js", + "watch": "npm run development -- --watch", + "watch-poll": "npm run watch -- --watch-poll", + "hot": "cross-env NODE_ENV=development node_modules/webpack-dev-server/bin/webpack-dev-server.js --inline --hot --config=node_modules/laravel-mix/setup/webpack.config.js", + "prod": "npm run production", + "production": "cross-env NODE_ENV=production node_modules/webpack/bin/webpack.js --no-progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js", + "test": "jest" + }, + "devDependencies": { + "@coreui/coreui": "^2.0.12", + "@coreui/coreui-plugin-chartjs-custom-tooltips": "1.2.0", + "@coreui/icons": "^0.3.0", + "@types/bluebird": "^3.5.25", + "@types/core-js": "^0.9.36", + "@types/jest": "^23.3.9", + "axios": "^0.18", + "babel-preset-stage-2": "^6.24.1", + "bootstrap": "^4.0.0", + "chart.js": "^2.7.3", + "cross-env": "^5.1", + "flag-icon-css": "3.2.0", + "font-awesome": "^4.7", + "jest": "^23.6.0", + "jquery": "^3.2", + "laravel-mix": "^2.0", + "pace-progress": "1.0.2", + "perfect-scrollbar": "1.4.0", + "popper.js": "^1.12", + "simple-line-icons": "2.4.1", + "ts-jest": "^23.10.5", + "vue": "^2.5.17", + "vuetable-2": "^1.7.5" + }, + "dependencies": { + "@types/lodash": "^4.14.118", + "@types/node": "^10.12.10", + "axios-progress-bar": "^1.2.0", + "chalk": "^2.4.2", + "hashids": "^1.2.2", + "laravel-echo": "^1.4.0", + "lodash.get": "^4.4.2", + "puppeteer": "^1.15.0", + "quill": "^1.3.6", + "socket.io-client": "^2.1.1", + "ts-loader": "3.5.0", + "typescript": "^3.1.6", + "vue-affix": "^0.4.0", + "vue-chartjs": "^3.4.0", + "vue-events": "^3.1.0", + "vue-multiselect": "^2.1.3", + "vue-scrollactive": "^0.8.0", + "vue-select": "^2.5.1", + "vue-toastr": "^2.0.16", + "vuex": "^3.1.0" + } } diff --git a/phpunit.xml b/phpunit.xml index 6a1a6c03f7d5..515b5981ef0d 100644 --- a/phpunit.xml +++ b/phpunit.xml @@ -20,6 +20,10 @@ ./tests/Feature + + + ./tests/Pdf + diff --git a/tests/Pdf/PdfGenerationTest.php b/tests/Pdf/PdfGenerationTest.php new file mode 100644 index 000000000000..c3bbba6bb6a2 --- /dev/null +++ b/tests/Pdf/PdfGenerationTest.php @@ -0,0 +1,33 @@ +save($pdf); + + $this->assertTrue(file_exists($pdf)); + + } +} diff --git a/tests/Pdf/invoice.html b/tests/Pdf/invoice.html new file mode 100644 index 000000000000..266d4b102977 --- /dev/null +++ b/tests/Pdf/invoice.html @@ -0,0 +1,213 @@ + + + + + A simple, clean, and responsive HTML invoice template + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + +
+ + + Invoice #: 123
+ Created: January 1, 2015
+ Due: February 1, 2015 +
+
+ + + + + + +
+ Sparksuite, Inc.
+ 12345 Sunny Road
+ Sunnyville, CA 12345 +
+ Acme Corp.
+ John Doe
+ john@example.com +
+
+ Payment Method + + Check # +
+ Check + + 1000 +
+ Item + + Price +
+ Website design + + $300.00 +
+ Hosting (3 months) + + $75.00 +
+ Domain name (1 year) + + $10.00 +
+ Total: $385.00 +
+
+ + \ No newline at end of file