v0.9.1 - You can now convert menuplan to pdf

This commit is contained in:
Neerholt 2020-08-12 15:25:29 +02:00
parent e06504b5fb
commit c84d2a3d73
8 changed files with 274 additions and 188 deletions

View File

@ -4,7 +4,6 @@
<include_path>
<path value="$PROJECT_DIR$/skolehjem/vendor/psr/container" />
<path value="$PROJECT_DIR$/skolehjem/vendor/psr/event-dispatcher" />
<path value="$PROJECT_DIR$/skolehjem/vendor/psr/http-factory" />
<path value="$PROJECT_DIR$/skolehjem/vendor/psr/http-message" />
<path value="$PROJECT_DIR$/skolehjem/vendor/psr/log" />
<path value="$PROJECT_DIR$/skolehjem/vendor/psr/simple-cache" />
@ -26,8 +25,6 @@
<path value="$PROJECT_DIR$/skolehjem/vendor/vlucas/phpdotenv" />
<path value="$PROJECT_DIR$/skolehjem/vendor/dnoegel/php-xdg-base-dir" />
<path value="$PROJECT_DIR$/skolehjem/vendor/egulias/email-validator" />
<path value="$PROJECT_DIR$/skolehjem/vendor/laminas/laminas-diactoros" />
<path value="$PROJECT_DIR$/skolehjem/vendor/laminas/laminas-zendframework-bridge" />
<path value="$PROJECT_DIR$/skolehjem/vendor/laravel/framework" />
<path value="$PROJECT_DIR$/skolehjem/vendor/laravel/passport" />
<path value="$PROJECT_DIR$/skolehjem/vendor/laravel/tinker" />
@ -62,8 +59,6 @@
<path value="$PROJECT_DIR$/skolehjem/vendor/doctrine/inflector" />
<path value="$PROJECT_DIR$/skolehjem/vendor/doctrine/lexer" />
<path value="$PROJECT_DIR$/skolehjem/vendor/firebase/php-jwt" />
<path value="$PROJECT_DIR$/skolehjem/vendor/lcobucci/jwt" />
<path value="$PROJECT_DIR$/skolehjem/vendor/php-http/message-factory" />
<path value="$PROJECT_DIR$/skolehjem/vendor/fideloper/proxy" />
<path value="$PROJECT_DIR$/skolehjem/vendor/fruitcake/laravel-cors" />
<path value="$PROJECT_DIR$/skolehjem/vendor/paragonie/random_compat" />
@ -120,6 +115,14 @@
<path value="$PROJECT_DIR$/skolehjem/vendor/myclabs/deep-copy" />
<path value="$PROJECT_DIR$/skolehjem/vendor/phar-io/manifest" />
<path value="$PROJECT_DIR$/skolehjem/vendor/laravelcollective/html" />
<path value="$PROJECT_DIR$/skolehjem/vendor/directorytree/ldaprecord" />
<path value="$PROJECT_DIR$/skolehjem/vendor/directorytree/ldaprecord-laravel" />
<path value="$PROJECT_DIR$/skolehjem/vendor/tightenco/collect" />
<path value="$PROJECT_DIR$/skolehjem/vendor/dompdf/dompdf" />
<path value="$PROJECT_DIR$/skolehjem/vendor/barryvdh/laravel-dompdf" />
<path value="$PROJECT_DIR$/skolehjem/vendor/phenx/php-font-lib" />
<path value="$PROJECT_DIR$/skolehjem/vendor/sabberworm/php-css-parser" />
<path value="$PROJECT_DIR$/skolehjem/vendor/phenx/php-svg-lib" />
</include_path>
</component>
<component name="PhpProjectSharedConfiguration" php_language_level="7.2" />

View File

@ -7,6 +7,7 @@
<sourceFolder url="file://$MODULE_DIR$/tests" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/spec" isTestSource="true" />
<excludeFolder url="file://$MODULE_DIR$/skolehjem/vendor/asm89/stack-cors" />
<excludeFolder url="file://$MODULE_DIR$/skolehjem/vendor/barryvdh/laravel-dompdf" />
<excludeFolder url="file://$MODULE_DIR$/skolehjem/vendor/brick/math" />
<excludeFolder url="file://$MODULE_DIR$/skolehjem/vendor/composer" />
<excludeFolder url="file://$MODULE_DIR$/skolehjem/vendor/defuse/php-encryption" />
@ -14,6 +15,7 @@
<excludeFolder url="file://$MODULE_DIR$/skolehjem/vendor/doctrine/inflector" />
<excludeFolder url="file://$MODULE_DIR$/skolehjem/vendor/doctrine/instantiator" />
<excludeFolder url="file://$MODULE_DIR$/skolehjem/vendor/doctrine/lexer" />
<excludeFolder url="file://$MODULE_DIR$/skolehjem/vendor/dompdf/dompdf" />
<excludeFolder url="file://$MODULE_DIR$/skolehjem/vendor/dragonmantank/cron-expression" />
<excludeFolder url="file://$MODULE_DIR$/skolehjem/vendor/egulias/email-validator" />
<excludeFolder url="file://$MODULE_DIR$/skolehjem/vendor/facade/flare-client-php" />
@ -30,14 +32,11 @@
<excludeFolder url="file://$MODULE_DIR$/skolehjem/vendor/hamcrest/hamcrest-php" />
<excludeFolder url="file://$MODULE_DIR$/skolehjem/vendor/jaybizzle/crawler-detect" />
<excludeFolder url="file://$MODULE_DIR$/skolehjem/vendor/jenssegers/agent" />
<excludeFolder url="file://$MODULE_DIR$/skolehjem/vendor/laminas/laminas-diactoros" />
<excludeFolder url="file://$MODULE_DIR$/skolehjem/vendor/laminas/laminas-zendframework-bridge" />
<excludeFolder url="file://$MODULE_DIR$/skolehjem/vendor/laravel/framework" />
<excludeFolder url="file://$MODULE_DIR$/skolehjem/vendor/laravel/passport" />
<excludeFolder url="file://$MODULE_DIR$/skolehjem/vendor/laravel/tinker" />
<excludeFolder url="file://$MODULE_DIR$/skolehjem/vendor/laravel/ui" />
<excludeFolder url="file://$MODULE_DIR$/skolehjem/vendor/laravelcollective/html" />
<excludeFolder url="file://$MODULE_DIR$/skolehjem/vendor/lcobucci/jwt" />
<excludeFolder url="file://$MODULE_DIR$/skolehjem/vendor/league/commonmark" />
<excludeFolder url="file://$MODULE_DIR$/skolehjem/vendor/league/event" />
<excludeFolder url="file://$MODULE_DIR$/skolehjem/vendor/league/flysystem" />
@ -54,7 +53,8 @@
<excludeFolder url="file://$MODULE_DIR$/skolehjem/vendor/paragonie/random_compat" />
<excludeFolder url="file://$MODULE_DIR$/skolehjem/vendor/phar-io/manifest" />
<excludeFolder url="file://$MODULE_DIR$/skolehjem/vendor/phar-io/version" />
<excludeFolder url="file://$MODULE_DIR$/skolehjem/vendor/php-http/message-factory" />
<excludeFolder url="file://$MODULE_DIR$/skolehjem/vendor/phenx/php-font-lib" />
<excludeFolder url="file://$MODULE_DIR$/skolehjem/vendor/phenx/php-svg-lib" />
<excludeFolder url="file://$MODULE_DIR$/skolehjem/vendor/phpdocumentor/reflection-common" />
<excludeFolder url="file://$MODULE_DIR$/skolehjem/vendor/phpdocumentor/reflection-docblock" />
<excludeFolder url="file://$MODULE_DIR$/skolehjem/vendor/phpdocumentor/type-resolver" />
@ -69,7 +69,6 @@
<excludeFolder url="file://$MODULE_DIR$/skolehjem/vendor/phpunit/phpunit" />
<excludeFolder url="file://$MODULE_DIR$/skolehjem/vendor/psr/container" />
<excludeFolder url="file://$MODULE_DIR$/skolehjem/vendor/psr/event-dispatcher" />
<excludeFolder url="file://$MODULE_DIR$/skolehjem/vendor/psr/http-factory" />
<excludeFolder url="file://$MODULE_DIR$/skolehjem/vendor/psr/http-message" />
<excludeFolder url="file://$MODULE_DIR$/skolehjem/vendor/psr/log" />
<excludeFolder url="file://$MODULE_DIR$/skolehjem/vendor/psr/simple-cache" />
@ -77,6 +76,7 @@
<excludeFolder url="file://$MODULE_DIR$/skolehjem/vendor/ralouphie/getallheaders" />
<excludeFolder url="file://$MODULE_DIR$/skolehjem/vendor/ramsey/collection" />
<excludeFolder url="file://$MODULE_DIR$/skolehjem/vendor/ramsey/uuid" />
<excludeFolder url="file://$MODULE_DIR$/skolehjem/vendor/sabberworm/php-css-parser" />
<excludeFolder url="file://$MODULE_DIR$/skolehjem/vendor/scrivo/highlight.php" />
<excludeFolder url="file://$MODULE_DIR$/skolehjem/vendor/sebastian/code-unit-reverse-lookup" />
<excludeFolder url="file://$MODULE_DIR$/skolehjem/vendor/sebastian/comparator" />

View File

@ -2,10 +2,12 @@
namespace App\Http\Controllers;
use App;
use App\ExternalLink;
use App\MenuPlan;
use App\News;
use App\User;
use Illuminate\Http\RedirectResponse;
use Illuminate\Http\Request;
use Illuminate\Http\Response;
use Illuminate\Support\Facades\DB;
@ -156,7 +158,7 @@ class MenuPlanController extends Controller
* Remove the specified resource from storage.
* Test delete return index function.
* @param int $id
* @return \Illuminate\Http\RedirectResponse
* @return RedirectResponse
*/
public function destroy($id)
{
@ -165,5 +167,19 @@ class MenuPlanController extends Controller
return redirect()->route("menu-plans.index");
}
/**
* Remove the specified resource from storage.
* Test delete return index function.
* @param $Id
* @return RedirectResponse
*/
public function genPDF($Id){
$menuPlan = MenuPlan::query()->where("id", "=", $Id)->first();
$pdf = \Illuminate\Support\Facades\App::make('dompdf.wrapper');
$data = '<div style="text-align: center">'. '<h1 style="font-size: 36px">Uge '. $menuPlan->week. '</h1>' .$menuPlan->menu. '</div>';
$pdf->loadHTML($data);
return $pdf->stream();
}
}

View File

@ -9,6 +9,7 @@
"license": "MIT",
"require": {
"php": "^7.2.5",
"barryvdh/laravel-dompdf": "^0.8.6",
"fideloper/proxy": "^4.2",
"fruitcake/laravel-cors": "^1.0",
"guzzlehttp/guzzle": "^6.3",

414
skolehjem/composer.lock generated
View File

@ -4,7 +4,7 @@
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
"This file is @generated automatically"
],
"content-hash": "8ba128c6252a57bde3eb22750ed51bef",
"content-hash": "8e62a745d683f5494f4d1efefc047dfd",
"packages": [
{
"name": "asm89/stack-cors",
@ -58,6 +58,62 @@
],
"time": "2019-12-24T22:41:47+00:00"
},
{
"name": "barryvdh/laravel-dompdf",
"version": "v0.8.6",
"source": {
"type": "git",
"url": "https://github.com/barryvdh/laravel-dompdf.git",
"reference": "d7108f78cf5254a2d8c224542967f133e5a6d4e8"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/barryvdh/laravel-dompdf/zipball/d7108f78cf5254a2d8c224542967f133e5a6d4e8",
"reference": "d7108f78cf5254a2d8c224542967f133e5a6d4e8",
"shasum": ""
},
"require": {
"dompdf/dompdf": "^0.8",
"illuminate/support": "^5.5|^6|^7",
"php": ">=7"
},
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "0.8-dev"
},
"laravel": {
"providers": [
"Barryvdh\\DomPDF\\ServiceProvider"
],
"aliases": {
"PDF": "Barryvdh\\DomPDF\\Facade"
}
}
},
"autoload": {
"psr-4": {
"Barryvdh\\DomPDF\\": "src"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Barry vd. Heuvel",
"email": "barryvdh@gmail.com"
}
],
"description": "A DOMPDF Wrapper for Laravel",
"keywords": [
"dompdf",
"laravel",
"pdf"
],
"time": "2020-02-25T20:44:34+00:00"
},
{
"name": "brick/math",
"version": "0.8.15",
@ -102,12 +158,6 @@
"brick",
"math"
],
"funding": [
{
"url": "https://tidelift.com/funding/github/packagist/brick/math",
"type": "tidelift"
}
],
"time": "2020-04-15T15:59:35+00:00"
},
{
@ -218,20 +268,6 @@
"uppercase",
"words"
],
"funding": [
{
"url": "https://www.doctrine-project.org/sponsorship.html",
"type": "custom"
},
{
"url": "https://www.patreon.com/phpdoctrine",
"type": "patreon"
},
{
"url": "https://tidelift.com/funding/github/packagist/doctrine%2Finflector",
"type": "tidelift"
}
],
"time": "2020-05-29T15:13:26+00:00"
},
{
@ -294,21 +330,73 @@
"parser",
"php"
],
"funding": [
"time": "2020-05-25T17:44:05+00:00"
},
{
"name": "dompdf/dompdf",
"version": "v0.8.5",
"source": {
"type": "git",
"url": "https://github.com/dompdf/dompdf.git",
"reference": "6782abfc090b132134cd6cea0ec6d76f0fce2c56"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/dompdf/dompdf/zipball/6782abfc090b132134cd6cea0ec6d76f0fce2c56",
"reference": "6782abfc090b132134cd6cea0ec6d76f0fce2c56",
"shasum": ""
},
"require": {
"ext-dom": "*",
"ext-mbstring": "*",
"phenx/php-font-lib": "^0.5.1",
"phenx/php-svg-lib": "^0.3.3",
"php": "^7.1"
},
"require-dev": {
"phpunit/phpunit": "^7.5",
"squizlabs/php_codesniffer": "^3.5"
},
"suggest": {
"ext-gd": "Needed to process images",
"ext-gmagick": "Improves image processing performance",
"ext-imagick": "Improves image processing performance"
},
"type": "library",
"extra": {
"branch-alias": {
"dev-develop": "0.7-dev"
}
},
"autoload": {
"psr-4": {
"Dompdf\\": "src/"
},
"classmap": [
"lib/"
]
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"LGPL-2.1"
],
"authors": [
{
"url": "https://www.doctrine-project.org/sponsorship.html",
"type": "custom"
"name": "Fabien Ménager",
"email": "fabien.menager@gmail.com"
},
{
"url": "https://www.patreon.com/phpdoctrine",
"type": "patreon"
"name": "Brian Sweeney",
"email": "eclecticgeek@gmail.com"
},
{
"url": "https://tidelift.com/funding/github/packagist/doctrine%2Flexer",
"type": "tidelift"
"name": "Gabriel Bull",
"email": "me@gabrielbull.com"
}
],
"time": "2020-05-25T17:44:05+00:00"
"description": "DOMPDF is a CSS 2.1 compliant HTML to PDF converter",
"homepage": "https://github.com/dompdf/dompdf",
"time": "2020-02-20T03:52:51+00:00"
},
{
"name": "dragonmantank/cron-expression",
@ -542,12 +630,6 @@
"crossdomain",
"laravel"
],
"funding": [
{
"url": "https://github.com/barryvdh",
"type": "github"
}
],
"time": "2020-04-28T08:47:37+00:00"
},
{
@ -1356,12 +1438,6 @@
"sftp",
"storage"
],
"funding": [
{
"url": "https://offset.earth/frankdejonge",
"type": "other"
}
],
"time": "2020-05-18T15:13:39+00:00"
},
{
@ -1495,16 +1571,6 @@
"logging",
"psr-3"
],
"funding": [
{
"url": "https://github.com/Seldaek",
"type": "github"
},
{
"url": "https://tidelift.com/funding/github/packagist/monolog/monolog",
"type": "tidelift"
}
],
"time": "2020-05-22T08:12:19+00:00"
},
{
@ -1709,6 +1775,83 @@
],
"time": "2020-06-07T11:41:29+00:00"
},
{
"name": "phenx/php-font-lib",
"version": "0.5.2",
"source": {
"type": "git",
"url": "https://github.com/PhenX/php-font-lib.git",
"reference": "ca6ad461f032145fff5971b5985e5af9e7fa88d8"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/PhenX/php-font-lib/zipball/ca6ad461f032145fff5971b5985e5af9e7fa88d8",
"reference": "ca6ad461f032145fff5971b5985e5af9e7fa88d8",
"shasum": ""
},
"require-dev": {
"phpunit/phpunit": "^4.8.35 || ^5 || ^6 || ^7"
},
"type": "library",
"autoload": {
"psr-4": {
"FontLib\\": "src/FontLib"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"LGPL-3.0"
],
"authors": [
{
"name": "Fabien Ménager",
"email": "fabien.menager@gmail.com"
}
],
"description": "A library to read, parse, export and make subsets of different types of font files.",
"homepage": "https://github.com/PhenX/php-font-lib",
"time": "2020-03-08T15:31:32+00:00"
},
{
"name": "phenx/php-svg-lib",
"version": "v0.3.3",
"source": {
"type": "git",
"url": "https://github.com/PhenX/php-svg-lib.git",
"reference": "5fa61b65e612ce1ae15f69b3d223cb14ecc60e32"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/PhenX/php-svg-lib/zipball/5fa61b65e612ce1ae15f69b3d223cb14ecc60e32",
"reference": "5fa61b65e612ce1ae15f69b3d223cb14ecc60e32",
"shasum": ""
},
"require": {
"sabberworm/php-css-parser": "^8.3"
},
"require-dev": {
"phpunit/phpunit": "^5.5|^6.5"
},
"type": "library",
"autoload": {
"psr-4": {
"Svg\\": "src/Svg"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"LGPL-3.0"
],
"authors": [
{
"name": "Fabien Ménager",
"email": "fabien.menager@gmail.com"
}
],
"description": "A library to read, parse and export to PDF SVG files.",
"homepage": "https://github.com/PhenX/php-svg-lib",
"time": "2019-09-11T20:02:13+00:00"
},
{
"name": "phpoption/phpoption",
"version": "1.7.4",
@ -1762,16 +1905,6 @@
"php",
"type"
],
"funding": [
{
"url": "https://github.com/GrahamCampbell",
"type": "github"
},
{
"url": "https://tidelift.com/funding/github/packagist/phpoption/phpoption",
"type": "tidelift"
}
],
"time": "2020-06-07T10:40:07+00:00"
},
{
@ -2266,13 +2399,52 @@
"identifier",
"uuid"
],
"funding": [
"time": "2020-03-29T20:13:32+00:00"
},
{
"name": "sabberworm/php-css-parser",
"version": "8.3.1",
"source": {
"type": "git",
"url": "https://github.com/sabberworm/PHP-CSS-Parser.git",
"reference": "d217848e1396ef962fb1997cf3e2421acba7f796"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/sabberworm/PHP-CSS-Parser/zipball/d217848e1396ef962fb1997cf3e2421acba7f796",
"reference": "d217848e1396ef962fb1997cf3e2421acba7f796",
"shasum": ""
},
"require": {
"php": ">=5.3.2"
},
"require-dev": {
"codacy/coverage": "^1.4",
"phpunit/phpunit": "~4.8"
},
"type": "library",
"autoload": {
"psr-0": {
"Sabberworm\\CSS": "lib/"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"url": "https://github.com/ramsey",
"type": "github"
"name": "Raphael Schweikert"
}
],
"time": "2020-03-29T20:13:32+00:00"
"description": "Parser for CSS Files written in PHP",
"homepage": "http://www.sabberworm.com/blog/2010/6/10/php-css-parser",
"keywords": [
"css",
"parser",
"stylesheet"
],
"time": "2020-06-01T09:10:00+00:00"
},
{
"name": "spatie/laravel-permission",
@ -2340,12 +2512,6 @@
"security",
"spatie"
],
"funding": [
{
"url": "https://spatie.be/open-source/support-us",
"type": "custom"
}
],
"time": "2020-05-20T00:31:29+00:00"
},
{
@ -2586,20 +2752,6 @@
],
"description": "A generic function and convention to trigger deprecation notices",
"homepage": "https://symfony.com",
"funding": [
{
"url": "https://symfony.com/sponsor",
"type": "custom"
},
{
"url": "https://github.com/fabpot",
"type": "github"
},
{
"url": "https://tidelift.com/funding/github/packagist/symfony/symfony",
"type": "tidelift"
}
],
"time": "2020-05-27T08:34:37+00:00"
},
{
@ -2787,20 +2939,6 @@
"interoperability",
"standards"
],
"funding": [
{
"url": "https://symfony.com/sponsor",
"type": "custom"
},
{
"url": "https://github.com/fabpot",
"type": "github"
},
{
"url": "https://tidelift.com/funding/github/packagist/symfony/symfony",
"type": "tidelift"
}
],
"time": "2020-05-20T17:43:50+00:00"
},
{
@ -3507,20 +3645,6 @@
"portable",
"shim"
],
"funding": [
{
"url": "https://symfony.com/sponsor",
"type": "custom"
},
{
"url": "https://github.com/fabpot",
"type": "github"
},
{
"url": "https://tidelift.com/funding/github/packagist/symfony/symfony",
"type": "tidelift"
}
],
"time": "2020-05-12T16:47:27+00:00"
},
{
@ -3845,20 +3969,6 @@
"interoperability",
"standards"
],
"funding": [
{
"url": "https://symfony.com/sponsor",
"type": "custom"
},
{
"url": "https://github.com/fabpot",
"type": "github"
},
{
"url": "https://tidelift.com/funding/github/packagist/symfony/symfony",
"type": "tidelift"
}
],
"time": "2020-05-20T17:43:50+00:00"
},
{
@ -4300,16 +4410,6 @@
"env",
"environment"
],
"funding": [
{
"url": "https://github.com/GrahamCampbell",
"type": "github"
},
{
"url": "https://tidelift.com/funding/github/packagist/vlucas/phpdotenv",
"type": "tidelift"
}
],
"time": "2020-06-07T18:25:35+00:00"
},
{
@ -4416,20 +4516,6 @@
"constructor",
"instantiate"
],
"funding": [
{
"url": "https://www.doctrine-project.org/sponsorship.html",
"type": "custom"
},
{
"url": "https://www.patreon.com/phpdoctrine",
"type": "patreon"
},
{
"url": "https://tidelift.com/funding/github/packagist/doctrine%2Finstantiator",
"type": "tidelift"
}
],
"time": "2020-05-29T17:27:14+00:00"
},
{
@ -4484,12 +4570,6 @@
"flare",
"reporting"
],
"funding": [
{
"url": "https://www.patreon.com/spatie",
"type": "patreon"
}
],
"time": "2020-03-02T15:52:04+00:00"
},
{
@ -4950,20 +5030,6 @@
"php",
"symfony"
],
"funding": [
{
"url": "https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=66BYDWAT92N6L",
"type": "custom"
},
{
"url": "https://github.com/nunomaduro",
"type": "github"
},
{
"url": "https://www.patreon.com/nunomaduro",
"type": "patreon"
}
],
"time": "2020-04-04T19:56:08+00:00"
},
{
@ -5681,12 +5747,6 @@
"highlight.php",
"syntax"
],
"funding": [
{
"url": "https://github.com/allejo",
"type": "github"
}
],
"time": "2020-03-02T05:59:21+00:00"
},
{

View File

@ -161,6 +161,7 @@ return [
Illuminate\Translation\TranslationServiceProvider::class,
Illuminate\Validation\ValidationServiceProvider::class,
Illuminate\View\ViewServiceProvider::class,
Barryvdh\DomPDF\ServiceProvider::class,
/*
* Package Service Providers...

View File

@ -19,12 +19,14 @@
<table class="tbl mt-2">
<tr>
<th>Uge</th>
<th style="width: 1em;"><img class="w-100" src="{{ asset('/images/icons/print.svg') }}" alt="Print"></th>
<th style="width: 1em;"><img class="w-100" src="{{ asset('/images/icons/pencil.svg') }}" alt="Update"></th>
<th style="width: 1em;"><img class="w-100" src="{{ asset('/images/icons/trashcan.svg') }}" alt="Delete"></th>
</tr>
@foreach($menuPlans as $menuplan)
<tr>
<td>{{$menuplan->week}}</td>
<td><a href="{{ route("pdf.genPDF", [ "menuPlan" => $menuplan ]) }}"><img class="w-100" src="{{ asset('/images/icons/print.svg') }}" alt="Print"></a></td>
<td><a href="{{ route("menu-plans.edit", [ "menu_plan" => $menuplan ]) }}"><img class="w-100" src="{{ asset('/images/icons/pencil-dark.svg') }}" alt="Update"></a></td>
<td><form method="post" action="{{ route("menu-plans.destroy", [ "menu_plan" => $menuplan ]) }}" class="w-100 nostyle">
@csrf

View File

@ -49,6 +49,9 @@ Route::get("/risrosapi", "FeedbackController@search")->name("feedbacks.search");
Route::get("/languages", "UserController@setLanguages")->name("users.setLanguages");
Route::get("/darkmode", "UserController@setDarkMode")->name("users.setDarkMode");
//Convert to PDF
Route::get("/pdf/{menuPlan}", "MenuPlanController@genPDF")->name("pdf.genPDF")->hasParameter("Id");
Route::resource("contacts", "ContactController");
Route::resource("menu-plans", "MenuPlanController");