LaravelDaily / laravel-invoices

Laravel package to generate PDF invoices from various customizable parameters
GNU General Public License v3.0
1.37k stars 298 forks source link

Css and Style not working #33

Closed HADES-TECH closed 4 years ago

HADES-TECH commented 4 years ago

This really is an amazing Package and eases many things in invoice generation. But I am having an issue: When I try to Stream or download the PDF it doesn't work and web page just keeps on loading. But when I comment out the CSS link and Style, it downloads.

sprklinginfo commented 4 years ago

Can't remember where I saw it. changing the style line as below solved the issue. don't know why. from: <link rel="stylesheet" href="{{ asset('/vendor/invoices/bootstrap.min.css') }}"> to: <link rel="stylesheet" href="{{ public_path('/vendor/invoices/bootstrap.min.css') }}">

PovilasKorop commented 4 years ago

@HADES-TECH try that solution by @sprklinginfo and tell us if it works, so we could close the issue

HADES-TECH commented 4 years ago

By changing asset to public path, blade view is not detecting the css link. But it works for me, Thanks.

HADES-TECH commented 4 years ago

Also, Is this the correct way to save file in desired folder? ->save(public_path('uploads/release')); It gives me this exception: InvalidArgumentException Disk [C:\Users\KN7\Desktop\Living Fashions\Laravel Projects\lfims\public\uploads/release] does not have a configured driver.

mc0de commented 4 years ago

@HADES-TECH define your disk in config/filesystems.php

it looks like this

    'disks' => [

        'local' => [
            'driver' => 'local',
            'root' => storage_path('app'),
        ],

        'public' => [
            'driver' => 'local',
            'root' => storage_path('app/public'),
            'url' => env('APP_URL').'/storage',
            'visibility' => 'public',
        ],
...

then use for example ->save('public') or ->save('yourdisk')