stever

stever

Member Since 1 Year Ago

Experience Points
3,000
Total
Experience

2,000 experience to go until the next level!

In case you were wondering, you earn Laracasts experience when you:

  • Complete a lesson — 100pts
  • Create a forum thread — 50pts
  • Reply to a thread — 10pts
  • Leave a reply that is liked — 50pts
  • Receive a "Best Reply" award — 500pts
Lessons Completed
28
Lessons
Completed
Best Reply Awards
0
Best Reply
Awards
  • start your engines Created with Sketch.

    Start Your Engines

    Earned once you have completed your first Laracasts lesson.

  • first-thousand Created with Sketch.

    First Thousand

    Earned once you have earned your first 1000 experience points.

  • 1-year Created with Sketch.

    One Year Member

    Earned when you have been with Laracasts for 1 year.

  • 2-years Created with Sketch.

    Two Year Member

    Earned when you have been with Laracasts for 2 years.

  • 3-years Created with Sketch.

    Three Year Member

    Earned when you have been with Laracasts for 3 years.

  • 4-years Created with Sketch.

    Four Year Member

    Earned when you have been with Laracasts for 4 years.

  • 5-years Created with Sketch.

    Five Year Member

    Earned when you have been with Laracasts for 5 years.

  • school-in-session Created with Sketch.

    School In Session

    Earned when at least one Laracasts series has been fully completed.

  • welcome-newcomer Created with Sketch.

    Welcome To The Community

    Earned after your first post on the Laracasts forum.

  • full-time-student Created with Sketch.

    Full Time Learner

    Earned once 100 Laracasts lessons have been completed.

  • pay-it-forward Created with Sketch.

    Pay It Forward

    Earned once you receive your first "Best Reply" award on the Laracasts forum.

  • subscriber Created with Sketch.

    Subscriber

    Earned if you are a paying Laracasts subscriber.

  • lifer Created with Sketch.

    Lifer

    Earned if you have a lifetime subscription to Laracasts.

  • evangelist Created with Sketch.

    Laracasts Evangelist

    Earned if you share a link to Laracasts on social media. Please email [email protected] with your username and post URL to be awarded this badge.

  • chatty-cathy Created with Sketch.

    Chatty Cathy

    Earned once you have achieved 500 forum replies.

  • lara-veteran Created with Sketch.

    Laracasts Veteran

    Earned once your experience points passes 100,000.

  • 10k-strong Created with Sketch.

    Ten Thousand Strong

    Earned once your experience points hits 10,000.

  • lara-master Created with Sketch.

    Laracasts Master

    Earned once 1000 Laracasts lessons have been completed.

  • laracasts-tutor Created with Sketch.

    Laracasts Tutor

    Earned once your "Best Reply" award count is 100 or more.

  • laracasts-sensei Created with Sketch.

    Laracasts Sensei

    Earned once your experience points passes 1 million.

  • top-50 Created with Sketch.

    Top 50

    Earned once your experience points ranks in the top 50 of all Laracasts users.

Level 1
3,000 XP
Oct
06
2 weeks ago
Activity icon

Replied to DOMPDF - "Maximum Function Nesting Level Of '512' Reached, Aborting!

Success. I still have to work on the options to get it to render properly but that will be some playing around for the morning.

This is what I did in my project directory:

[email protected]:~/projects/laravel$ COMPOSER_MEMORY_LIMIT=-1 composer require dompdf/dompdf
[email protected]:~/projects/laravel$ COMPOSER_MEMORY_LIMIT=-1 composer update

In the Controller:

use Dompdf\Dompdf;
    public function requisition($id)
    {
            // Get default limit
             //$normalTimeLimit = ini_get('max_execution_time');
             //ini_set('max_execution_time', -1);
            // $pdf = PDF::loadView('patient.requisition');
            // $pdf->save("stevereq.pdf");
            // Restore default limit
            // ini_set('max_execution_time', $normalTimeLimit);
            // dd($pdf);
            // return view('patient.requisition');
            $html = View('patient.requisition');
            $dompdf = new DOMPDF();
            $dompdf->loadHtml($html);
            $dompdf->render();
            $output = $dompdf->output();
            file_put_contents ('stevereq.pdf', $output);
    }
Oct
05
2 weeks ago
Activity icon

Replied to DOMPDF - "Maximum Function Nesting Level Of '512' Reached, Aborting!

Sorry for the delay. My workstation was swapping as the php process was using 5g.

What do you mean by using dompdf directly? Do you have a link that you could provide?

Activity icon

Replied to DOMPDF - "Maximum Function Nesting Level Of '512' Reached, Aborting!

I have other PDFs working with DOMPDF. I changed the parameters as outlined:

[email protected]:/etc/php/7.3/fpm# grep max_execution_time php.ini
max_execution_time = -1
[email protected]:/etc/php/7.3/fpm# grep memory_limit php.ini
memory_limit = -1
    

public function requisition($id)
    {
            // Get default limit
            $normalTimeLimit = ini_get('max_execution_time');
            ini_set('max_execution_time', -1);
            $pdf = PDF::loadView('patient.requisition');
            $pdf->save("stevereq.pdf");
            // Restore default limit
            ini_set('max_execution_time', $normalTimeLimit);
            dd($pdf);
            return view('patient.requisition');
    }

This is the requisition.blade.php. Sorry about the mess as I haven't gone through and cleaned it up. Good news is that there is no data in it yet so it is standalone. The layouts.req only has the requirements for jquery and bootstrap.

@extends('layouts.req')

@section('content')
<div><h3 style="align:top">EPISIGN - CAN REQUISITION</h2></div>
<div><hr style="border: 1px solid black;" /></div>
<form class="form-inline">
<div class="container">
  <div class="row" style="overflow:hidden">
    <div class="col-sm-6">
        <div><h4 style="background-color:White">LAB USE ONLY</h4></div>
    <div class="col-sm-12" style="background-color:LightGray;margin-bottom: -99999px; padding-bottom: 99999px;">
        <label for="receivedDate" class="col-sm-4 pull-left" >Received date:</label>
        <div class="form-group">
                <div>
                        <input class="form-control"  type="text" name="receivedDate"/>
                </div>
        </div>
        <div class="form-group">
                <label for="notes" class="pull-left">Notes:</label>
                <div class="col-sm-8">
                        <textarea rows="10" cols="50" class="form-control" name="notes"></textarea>

                </div>
        </div>
    </div>
    </div>
        <div class="col-sm-6">
        <div><h4 style="align:top;background-color:White">PATIENT INFORMATION</h4></div>
        <div class="col-sm-12" style="align:top;background-color:LightGray;margin-bottom: -99999px; padding-bottom: 99999px;">
        <div class="container">
        <div class="row" style="background-color:LightGray;margin-bottom: -99999px; padding-bottom: 99999px;">
        <label for="patientName" class="pull-left">Name:</label>
        <div class="form-group">
                <div>
                        <input class="form-control"  type="text" name="patientName"/>
                </div>
        </div><br>
        <label for="dateOfBirth">Date of Birth:</label>
        <div class="form-group">
                <div>
                        <input class="form-control" style="width:60%" type="text" name="dateOfBirth"/>
                </div>
        </div>
        <label for="sex">Sex: </label>
        <div class="form-group">
                <div class="radio-inline">
                        <input type="radio" name="sex">M</>
                </div>
                <div class="radio-inline">
                        <input type="radio" name="sex">F</>
                </div>
        </div><br>
        <label for="patientId" class="pull-left">Patient Study ID*:</label>
        <div class="form-group">
                <div>
                        <input class="form-control"  style="width:100%" type="text" name="patientId"/>
                </div>
        </div><br>
        <label for="pedigre" class="pull-left">Referring Organization Pedigree/Kindred number:</label>
        <div class="form-group">
                <div>
                        <input class="form-control"  style="width:100%" type="text" name="pedigree"/>
                </div>
        </div><br>
        <label for="arm" class="pull-left">Arm of Study: </label>
        <div class="form-group">
                <div>
                        <select class="form-control"  name="arm">
                                <option selected>Select</option>
                                <option>First Tier</option>
                                <option>Episign Complete</option>
                        </select>
                </div>
        </div>
        <div class="text-wrap" style="width: 45rem;"><small>* Please note that this ID will change after patient is added to EpiSign study database.  LHSC will communicate this change to you.</small></div>
        </div>
    </div>
    </div>
    </div>
  </div>
</div>
<div><hr style="border: 1px solid black;" /></div>
        <div class="container">
        <div class="row" style="overflow:hidden">
        <div><h4>SAMPLE INFORMATION</h4></div>
        <div class="col" style="background-color:LightGray;margin-bottom: -99999px; padding-bottom: 99999px;">
        <label for="test" class="pull-left">Test:</label>
        <div class="form-group">
                <div>
                        <input class="form-control" type="text" name="test"/>
                </div>
        </div>
       <label for="test">Sample ID*:</label>
        <div class="form-group">
                <div>
                        <input class="form-control" type="text" name="test"/>
                </div>
        </div><br>
        <label for="age">Age at time fo sample collection (in years, please use decimal places if necessary):</label>
        <div class="form-group">
                <div>
                        <input class="form-control" type="text" name="age"/>
                </div>
        </div><br>
        <label for="sampleType">Sample Type:</label>
        <div class="form-group">
                <div>
                        <input  type="radio" name="sampleType">Blood sample (5 ml EDTA - lavender top)</>
                </div>
                <div>
                        <input  type="radio" name="sampleType">Banked DNA from peripheral blood</>
                </div>
        </div><br>
        <label for="dna">If DNA, specify concentration if possible (ng/ul):</label>
        <div class="form-group">
                <div>
                        <input class="form-control" type="text" name="dna"/>
                </div>
        </div><br>
<div><small>*Please note that this ID will change after patient is added to EpiSign study database.  LHSC will communication this change to you.</small></div>
        </div>
        </div>
        </div>
</div>
<div><hr style="border: 1px solid black;" /></div>
<div class="container">
        <div><h4>REFERRING PHYSICIAN</h4></div>
        <div class="row" style="overflow:hidden">
        <div class="col-sm-6" style="background-color:LightGray;margin-bottom: -99999px; padding-bottom: 99999px;">
        <div class="form-group">
        <label for="physicianName" class="col-2 ull-left" >Physician Name:<label>
                <div>
                        <input class="form-control" type="text" name="physicianName"/>
                </div>
        </div>
        <div class="form-group">
        <label for="phone" class="col-2 pull-left" >Phone Number:<label>
                <div>
                        <input class="form-control col-4" type="text" name="phone"/>
                </div>
        </div>
        <div class="form-group">
        <label for="fax" class="pull-left col-4" >Fax Number:<label>
                <div>
                        <input class="form-control" type="text" name="fax"/>
                </div>
        </div>
        <div class="form-group">
        <label for="address" class="pull-left col-4" >Address:<label>
                <div>
                        <textarea class="form-control" rows="4" name="address"></textarea>
                </div>
        </div>
        <div class="form-group">
        <label for="signature" class="pull-left col-4" >Signature:<label>
                <div>
                        <textarea class="form-control" rows="2" name="signature"></textarea>
                </div>
        </div>
        </div>
        <div class="col-6">
                <br><br><br><br>
                <div><img src="/img/episign_logo.png" style="margin:auto; display:block;"></div>
        </div>
</div>
</div>
</form>
<div><hr style="border: 1px solid black;" /></div>
<div class="container">
        <div class="row">
                <div class="col-sm-6">
                        <div>Molecular Genetics Laboratory</div>
                        <div>Victoria Hospital, Room B10-128</div>
                        <div>800 Commissioners Rd. E.</div>
                        <div>London, Ontario | N6A 5W9</div>
                        <div>Ph: 519-685-8122 | Fax: 519-685-8279</div>
                </div>
                <div class="col-sm-6">
                        <div><img src="/img/episign_logo.png" class="pull-right img-responsive"></div>
                </div>
        </div>
</div>
</div>
@endsection
Activity icon

Replied to DOMPDF - "Maximum Function Nesting Level Of '512' Reached, Aborting!

I changed: xdebug.max_nesting_level = 16384 to xdebug.max_nesting_level = -1 to disable xdebug. Trying your method.

[email protected]:/etc/php/7.3/mods-available# mv xdebug.ini xdebug
[email protected]:/etc/php/7.3/mods-available# systemctl restart php7.3-fpm.service

Good news is that your method of disabling xdebug is better as I progressed further. I then received a memory and an execution timeout message for the PDF generation so I changed the following in php.ini.

[email protected]:/etc/php/7.3/fpm$ sudo vi php.ini
max_execution_time = 120
memory_limit = 768M
[email protected]:/etc/php/7.3/fpm# sudo systemctl restart php7.3-fpm.service

I also changed the execution time in the Controller:

            // Get default limit
            $normalTimeLimit = ini_get('max_execution_time');
            ini_set('max_execution_time', 120);
            $pdf = PDF::loadView('patient.requisition');
            $pdf->save("stevereq.pdf");
            // Restore default limit
            ini_set('max_execution_time', $normalTimeLimit);
            dd($pdf);

The Controller runs for around 40 seconds and then silently dies. The 'dd($pdf)' is never executed. I am suspecting that this is a DOMPDF bug. The 7.3 fpm does not restart as the PID is the same.

Activity icon

Replied to DOMPDF - "Maximum Function Nesting Level Of '512' Reached, Aborting!

I went back and read those two posts again more carefully and

set xdebug.max_nesting_level = -1

to disable xdebug. This ran for the same amount of time and errored out with 502 BAD GATEWAY from nginx. It only ran for around 15 seconds so it is not near any of the timeouts on nginx (300 seconds).

Activity icon

Started a new Conversation DOMPDF - "Maximum Function Nesting Level Of '512' Reached, Aborting!

I am using 'PDF' => Barryvdh\DomPDF\Facade::class, to generate PDFs. In the controller,

             use PDF;
              .........

            $pdf = PDF::loadView('patient.requisition');
            $pdf->save("stevereq.pdf");

I bumped up the nesting level to 16K and am still getting the error.

[email protected]:/etc/php/7.3/mods-available$ more xdebug.ini
zend_extension=xdebug.so
xdebug.remote_enable = 1
xdebug.remote_connect_back = 1
xdebug.remote_port = 9000
xdebug.max_nesting_level = 16384

The error is thrown in:

    /**
     * @return FontMetrics
     */
    public function getFontMetrics()
    {
        return $this->fontMetrics;
    }

I am guessing that there is an infinite loop somewhere but I don't where to look. I don't have a lot invested in this PDF generator so if there is no quick solution can someone recommend a different PDF generator?

thanks steve

Jul
10
3 months ago
Activity icon

Replied to Laravel Complains That The Form I Am Submitting Is A GET Request And It Clearly Is A POST

Thanks @michaloravec . I created a put method and it fixed the problem. Here is the complete solution:

Route::put('/question/{question}/edit','[email protected]')->name('questions.edit');

update.blade.php

<body>
                <form action='/question/12/edit' method='post'>
                        @csrf
                        @method("PUT")
                        <button type='submit' class='btn btn-primary'>Save Question</button>
                </form>
</body>
Activity icon

Replied to Laravel Complains That The Form I Am Submitting Is A GET Request And It Clearly Is A POST

Here is the update update.blade.php

<body>
                <form action='/question/12/edit' method='post'>
                        @csrf
                        <button type='submit' class='btn btn-primary'>Save Question</button>
                </form>
</body>

The route:

Route::post('/question/{question}/edit','[email protected]')->name('questions.edit');

The Controller:

 public function edit(Request $request, Question $question)
    {

        dd($question);
    }
Activity icon

Replied to Laravel Complains That The Form I Am Submitting Is A GET Request And It Clearly Is A POST

The form is clearly supposed to be doing a post request. The HTML is only 5lines long so I don't have a problem with form nesting.

<body>
                <form action='/question/12/edit' method='post'>
                        @csrf
                        <button type='submit' class='btn btn-primary'>Save Question</button>
                </form>
</body>

New to the forum and am just learning the markup.

Activity icon

Replied to Laravel Complains That The Form I Am Submitting Is A GET Request And It Clearly Is A POST

The form is below. The controller does not get hit. In the update method I am just dumping out variables and it does not get that far.

Activity icon

Replied to Laravel Complains That The Form I Am Submitting Is A GET Request And It Clearly Is A POST

The update.blade.php without the tags. forum seems to have eaten them. one ? is the open < and ?? is the >

? form action='/question/12/edit' method='post' ?? @csrf

?button type='submit' class='btn btn-primary'??Save Question?/button??

/?form??

Activity icon

Started a new Conversation Laravel Complains That The Form I Am Submitting Is A GET Request And It Clearly Is A POST

The error message:

"The GET method is not supported for this route. Supported methods: POST."

update.blade.php - I removed everything and tried both types of quotes. I even tried methodtype="post" in the button. This is the entirety of the HTML:

@csrf Save Question

The Route:

Route::post('/question/{question}/edit','[email protected]')->name('questions.edit');

When I remove the route I get a 404.

Anyone seen anything like this or any recommendations to try?