mariiamozgunova's avatar

mariiamozgunova liked a comment+100 XP

2mos ago

websockets connection failed

hello , i installed laravel reverb with my application after the installation is done it show me websocket connection failed in the console

i did not change anything all the settings is by default am using docker with laravel sail keep in mind i run sail artisan reverb start and nothing work with me

if someone have any idea please help me

mariiamozgunova's avatar

mariiamozgunova liked a comment+100 XP

2mos ago

websockets connection failed

@youcefkacem Oh my god. Thank you so much! Spent hours trying to find a solution to this problem.

mariiamozgunova's avatar

mariiamozgunova liked a comment+100 XP

2mos ago

websockets connection failed

i fixed the issue by adding the following configuration in docker-compose.yml file

        - '${REVERB_SERVER_PORT:-8080}:8080'

make sure to add that in the docker compose file to use the port

now everything is fine

mariiamozgunova's avatar

mariiamozgunova liked a comment+100 XP

5mos ago

Cannot show image on header spatie/browsershot

Cannot show image on header browsershot library

use VerumConsilium\Browsershot\Facades\PDF;

Route::get('/test', function () {
    $bodyHtml = View::make('test.snap', compact('data'))->render();
    $headerHtml = View::make('test._header')->render();;

    $footerHtml = '<br><br>
        <h1 style="font-size: 10px;color: #999; margin: 15px 40px; clear:both; position: relative; top: 20px;">
      Page <span class="pageNumber"></span> of <span class="totalPages"></span>
    </h1>';

    /**
     * Browsershot
     */
    return PDF::loadHtml($bodyHtml)
        ->showBackground()
        ->showBrowserHeaderAndFooter()
        ->headerHtml($headerHtml)
        ->footerHtml($footerHtml)
        ->margins(30, 10, 30, 10)
        ->format('A4')
        ->inline();
});

_header.blade.php

<div style="font-size:14px;">Header </div>

<img src="https://onlinejpgtools.com/images/examples-onlinejpgtools/smile.jpg" alt="test" srcset="test">
<img src="{{ public_path('/images/phpt-logo.jpg') }}" alt="test">