mercredi 29 janvier 2020

Install mpdf or dompdf issue on laravel 5.2

I am trying to add dompdf on my laravel project using command-

composer require barryvdh/laravel-dompdf: 0.7.0

after installation i get error:

> [2020-01-29 17:45:54] local.ERROR: UnexpectedValueException: The > Response content must be a string or object implementing __toString(), > "boolean" given. in > D:\xampp\htdocs\mykidreport\vendor\symfony\http-foundation\Response.php:399 > Stack trace: > #0 D:\xampp\htdocs\mykidreport\vendor\laravel\framework\src\Illuminate\Http\Response.php(56): > Symfony\Component\HttpFoundation\Response->setContent(false) > #1 D:\xampp\htdocs\mykidreport\vendor\symfony\http-foundation\Response.php(201): > Illuminate\Http\Response->setContent(false) > #2 D:\xampp\htdocs\mykidreport\vendor\laravel\framework\src\Illuminate\Routing\Router.php(1085): > Symfony\Component\HttpFoundation\Response->__construct(false) > #3 D:\xampp\htdocs\mykidreport\vendor\laravel\framework\src\Illuminate\Routing\ControllerDispatcher.php(94): > Illuminate\Routing\Router->prepareResponse(Object(Illuminate\Http\Request), > false) > #4 [internal function]: Illuminate\Routing\ControllerDispatcher->Illuminate\Routing{closure}(Object(Illuminate\Http\Request)) > #5 D:\xampp\htdocs\mykidreport\vendor\laravel\framework\src\Illuminate\Routing\Pipeline.php(52): > call_user_func(Object(Closure), Object(Illuminate\Http\Request)) > #6 [internal function]: Illuminate\Routing\Pipeline->Illuminate\Routing{closure}(Object(Illuminate\Http\Request)) > #7 D:\xampp\htdocs\mykidreport\vendor\laravel\framework\src\Illuminate\Pipeline\Pipeline.php(102): > call_user_func(Object(Closure), Object(Illuminate\Http\Request)) > #8 D:\xampp\htdocs\mykidreport\vendor\laravel\framework\src\Illuminate\Routing\ControllerDispatcher.php(96): > Illuminate\Pipeline\Pipeline->then(Object(Closure)) > #9 D:\xampp\htdocs\mykidreport\vendor\laravel\framework\src\Illuminate\Routing\ControllerDispatcher.php(54): > Illuminate\Routing\ControllerDispatcher->callWithinStack(Object(App\Http\Controllers\DashboardController), > Object(Illuminate\Routing\Route), Object(Illuminate\Http\Request), > 'index') > #10 D:\xampp\htdocs\mykidreport\vendor\laravel\framework\src\Illuminate\Routing\Route.php(174): > Illuminate\Routing\ControllerDispatcher->dispatch(Object(Illuminate\Routing\Route), > Object(Illuminate\Http\Request), 'App\Http\Contro...', 'index') > #11 D:\xampp\htdocs\mykidreport\vendor\laravel\framework\src\Illuminate\Routing\Route.php(140): > Illuminate\Routing\Route->runController(Object(Illuminate\Http\Request)) > #12 D:\xampp\htdocs\mykidreport\vendor\laravel\framework\src\Illuminate\Routing\Router.php(724): > Illuminate\Routing\Route->run(Object(Illuminate\Http\Request)) > #13 [internal function]: Illuminate\Routing\Router->Illuminate\Routing{closure}(Object(Illuminate\Http\Request)) > #14 D:\xampp\htdocs\mykidreport\vendor\laravel\framework\src\Illuminate\Routing\Pipeline.php(52): > call_user_func(Object(Closure), Object(Illuminate\Http\Request)) > #15 D:\xampp\htdocs\mykidreport\vendor\laravel\framework\src\Illuminate\View\Middleware\ShareErrorsFromSession.php(49): > Illuminate\Routing\Pipeline->Illuminate\Routing{closure}(Object(Illuminate\Http\Request)) > #16 [internal function]: Illuminate\View\Middleware\ShareErrorsFromSession->handle(Object(Illuminate\Http\Request), > Object(Closure)) > #17 D:\xampp\htdocs\mykidreport\vendor\laravel\framework\src\Illuminate\Pipeline\Pipeline.php(136): > call_user_func_array(Array, Array) > #18 [internal function]: Illuminate\Pipeline\Pipeline->Illuminate\Pipeline{closure}(Object(Illuminate\Http\Request)) > #19 D:\xampp\htdocs\mykidreport\vendor\laravel\framework\src\Illuminate\Routing\Pipeline.php(32): > call_user_func(Object(Closure), Object(Illuminate\Http\Request)) > #20 D:\xampp\htdocs\mykidreport\vendor\laravel\framework\src\Illuminate\Session\Middleware\StartSession.php(64): > Illuminate\Routing\Pipeline->Illuminate\Routing{closure}(Object(Illuminate\Http\Request)) > #21 [internal function]: Illuminate\Session\Middleware\StartSession->handle(Object(Illuminate\Http\Request), > Object(Closure)) > #22 D:\xampp\htdocs\mykidreport\vendor\laravel\framework\src\Illuminate\Pipeline\Pipeline.php(136): > call_user_func_array(Array, Array) > #23 [internal function]: Illuminate\Pipeline\Pipeline->Illuminate\Pipeline{closure}(Object(Illuminate\Http\Request)) > #24 D:\xampp\htdocs\mykidreport\vendor\laravel\framework\src\Illuminate\Routing\Pipeline.php(32): > call_user_func(Object(Closure), Object(Illuminate\Http\Request)) > #25 D:\xampp\htdocs\mykidreport\vendor\laravel\framework\src\Illuminate\Cookie\Middleware\AddQueuedCookiesToResponse.php(37): > Illuminate\Routing\Pipeline->Illuminate\Routing{closure}(Object(Illuminate\Http\Request)) > #26 [internal function]: Illuminate\Cookie\Middleware\AddQueuedCookiesToResponse->handle(Object(Illuminate\Http\Request), > Object(Closure)) > #27 D:\xampp\htdocs\mykidreport\vendor\laravel\framework\src\Illuminate\Pipeline\Pipeline.php(136): > call_user_func_array(Array, Array) > #28 [internal function]: Illuminate\Pipeline\Pipeline->Illuminate\Pipeline{closure}(Object(Illuminate\Http\Request)) > #29 D:\xampp\htdocs\mykidreport\vendor\laravel\framework\src\Illuminate\Routing\Pipeline.php(32): > call_user_func(Object(Closure), Object(Illuminate\Http\Request)) > #30 D:\xampp\htdocs\mykidreport\vendor\laravel\framework\src\Illuminate\Cookie\Middleware\EncryptCookies.php(59): > Illuminate\Routing\Pipeline->Illuminate\Routing{closure}(Object(Illuminate\Http\Request)) > #31 [internal function]: Illuminate\Cookie\Middleware\EncryptCookies->handle(Object(Illuminate\Http\Request), > Object(Closure)) > #32 D:\xampp\htdocs\mykidreport\vendor\laravel\framework\src\Illuminate\Pipeline\Pipeline.php(136): > call_user_func_array(Array, Array) > #33 [internal function]: Illuminate\Pipeline\Pipeline->Illuminate\Pipeline{closure}(Object(Illuminate\Http\Request)) > #34 D:\xampp\htdocs\mykidreport\vendor\laravel\framework\src\Illuminate\Routing\Pipeline.php(32): > call_user_func(Object(Closure), Object(Illuminate\Http\Request)) > #35 [internal function]: Illuminate\Routing\Pipeline->Illuminate\Routing{closure}(Object(Illuminate\Http\Request)) > #36 D:\xampp\htdocs\mykidreport\vendor\laravel\framework\src\Illuminate\Pipeline\Pipeline.php(102): > call_user_func(Object(Closure), Object(Illuminate\Http\Request)) > #37 D:\xampp\htdocs\mykidreport\vendor\laravel\framework\src\Illuminate\Routing\Router.php(726): > Illuminate\Pipeline\Pipeline->then(Object(Closure)) > #38 D:\xampp\htdocs\mykidreport\vendor\laravel\framework\src\Illuminate\Routing\Router.php(699): > Illuminate\Routing\Router->runRouteWithinStack(Object(Illuminate\Routing\Route), > Object(Illuminate\Http\Request)) > #39 D:\xampp\htdocs\mykidreport\vendor\laravel\framework\src\Illuminate\Routing\Router.php(675): > Illuminate\Routing\Router->dispatchToRoute(Object(Illuminate\Http\Request)) > #40 D:\xampp\htdocs\mykidreport\vendor\laravel\framework\src\Illuminate\Foundation\Http\Kernel.php(246): > Illuminate\Routing\Router->dispatch(Object(Illuminate\Http\Request)) > #41 [internal function]: Illuminate\Foundation\Http\Kernel->Illuminate\Foundation\Http{closure}(Object(Illuminate\Http\Request)) > #42 D:\xampp\htdocs\mykidreport\vendor\laravel\framework\src\Illuminate\Routing\Pipeline.php(52): > call_user_func(Object(Closure), Object(Illuminate\Http\Request)) > #43 D:\xampp\htdocs\mykidreport\vendor\laravel\framework\src\Illuminate\Foundation\Http\Middleware\CheckForMaintenanceMode.php(44): > Illuminate\Routing\Pipeline->Illuminate\Routing{closure}(Object(Illuminate\Http\Request)) > #44 [internal function]: Illuminate\Foundation\Http\Middleware\CheckForMaintenanceMode->handle(Object(Illuminate\Http\Request), > Object(Closure)) > #45 D:\xampp\htdocs\mykidreport\vendor\laravel\framework\src\Illuminate\Pipeline\Pipeline.php(136): > call_user_func_array(Array, Array) > #46 [internal function]: Illuminate\Pipeline\Pipeline->Illuminate\Pipeline{closure}(Object(Illuminate\Http\Request)) > #47 D:\xampp\htdocs\mykidreport\vendor\laravel\framework\src\Illuminate\Routing\Pipeline.php(32): > call_user_func(Object(Closure), Object(Illuminate\Http\Request)) > #48 D:\xampp\htdocs\mykidreport\vendor\dingo\api\src\Http\Middleware\Request.php(111): > Illuminate\Routing\Pipeline->Illuminate\Routing{closure}(Object(Illuminate\Http\Request)) > #49 [internal function]: Dingo\Api\Http\Middleware\Request->handle(Object(Illuminate\Http\Request), > Object(Closure)) > #50 D:\xampp\htdocs\mykidreport\vendor\laravel\framework\src\Illuminate\Pipeline\Pipeline.php(136): > call_user_func_array(Array, Array) > #51 [internal function]: Illuminate\Pipeline\Pipeline->Illuminate\Pipeline{closure}(Object(Illuminate\Http\Request)) > #52 D:\xampp\htdocs\mykidreport\vendor\laravel\framework\src\Illuminate\Routing\Pipeline.php(32): > call_user_func(Object(Closure), Object(Illuminate\Http\Request)) > #53 [internal function]: Illuminate\Routing\Pipeline->Illuminate\Routing{closure}(Object(Illuminate\Http\Request)) > #54 D:\xampp\htdocs\mykidreport\vendor\laravel\framework\src\Illuminate\Pipeline\Pipeline.php(102): > call_user_func(Object(Closure), Object(Illuminate\Http\Request)) > #55 D:\xampp\htdocs\mykidreport\vendor\laravel\framework\src\Illuminate\Foundation\Http\Kernel.php(132): > Illuminate\Pipeline\Pipeline->then(Object(Closure)) > #56 D:\xampp\htdocs\mykidreport\vendor\laravel\framework\src\Illuminate\Foundation\Http\Kernel.php(99): > Illuminate\Foundation\Http\Kernel->sendRequestThroughRouter(Object(Illuminate\Http\Request)) > #57 D:\xampp\htdocs\mykidreport\public\index.php(53): Illuminate\Foundation\Http\Kernel->handle(Object(Illuminate\Http\Request)) > #58 {main}

and my composer.json file looks like this

{
    "name": "laravel/laravel",
    "description": "The Laravel Framework.",
    "keywords": ["framework", "laravel"],
    "license": "MIT",
    "type": "project",
    "require": {
        "php": ">=5.5.9",
        "laravel/framework": "5.2.*",
        "tymon/jwt-auth": "0.5.*",
         "dingo/api": "1.0.x@dev",
          "laravel/socialite": "^2.0",
        "webpatser/laravel-uuid": "2.*"
    },
    "require-dev": {
        "fzaninotto/faker": "~1.4",
        "mockery/mockery": "0.9.*",
        "phpunit/phpunit": "~4.0"
    },
    "autoload": {
        "classmap": [
            "database"
        ],
        "psr-4": {
            "App\\": "app/"
        }
    },
    "autoload-dev": {
        "classmap": [
            "tests/TestCase.php"
        ]
    },
    "scripts": {
        "post-root-package-install": [
            "php -r \"copy('.env.example', '.env');\""
        ],
        "post-create-project-cmd": [
            "php artisan key:generate"
        ],
        "post-install-cmd": [
            "Illuminate\\Foundation\\ComposerScripts::postInstall",
            "php artisan optimize"
        ],
        "post-update-cmd": [
            "Illuminate\\Foundation\\ComposerScripts::postUpdate",
            "php artisan optimize"
        ]
    },
    "config": {
        "preferred-install": "dist"
    }
}


via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire