vincej

Experience

35,820

2 Best Reply Awards

  • Member Since 2 Years Ago
  • 158 Lessons Completed
  • 18 Favorites

30th March, 2017

vincej left a reply on Getting Login Error Since Upgrade To 5.4 • 1 hour ago

@Snapey

Hi Snapey, I have been looking at accessors etc having never used them before, and I have gotten as far as getting the value back out of the DB like this:

From my model (user_group is the db column name)

    public function getUserGroupAttribute($value){
        return ($value);
    }

Login Controller

    protected function redirectTo()
    {
                $user = User::find(19);
                $usergroup = $user->user_group;
          
             dd($usergroup);  //THIS WORKS

    }

And sure enough I am getting the correct user group out.

Question I do not understand how to make use of this syntax inside my model. Can you please help me understand how this works? I have got Matt Stauffers book, but he says nothing about this, and I can not find anying on Google far.

->isEnquirer should be referencing a function called "isEnquirer" ... but how that that fit with the accessor method, getUserGroupAttribute

 if(Auth::user()->isEnquirer) {
            return '/dashboard';

Sorry, I'm a bit lost here.

Many Thanks !

13th March, 2017

vincej left a reply on Why, Since 5.4 Upgrade Form::Open(['action' .... ]); No Longer Works • 2 weeks ago

yeah, I was using 5.4 then I though I'd give 5.4.1 a try to no effect.

I can get around it with a url, but it is a pain when something does not work as expected.

Many thanks !

vincej left a reply on Why, Since 5.4 Upgrade Form::Open(['action' .... ]); No Longer Works • 2 weeks ago

@jlrdw Thanks for that. I have 5.4.1 specified already in my composer file, without any errors on update.

vincej started a new conversation Why, Since 5.4 Upgrade Form::Open(['action' .... ]); No Longer Works • 2 weeks ago

I have googled this to death as well as looking through the upgrade guides. I can not see the reason why this is happening. Any ideas are welcome.

Under 5.1 my blade From Open actions all worked, now, no more. My expectation is that using the action method I do not need to define a specific route. My 'action' will generate the specified route to my controller function. I keep getting the error

ErrorException in UrlGenerator.php line 337:
Action App\Http\Controllers\ContractorPortal\[email protected]_update not defined. 

(View: /var/www/auburntree/resources/views/contractor_portal/change_password.blade.php)

BUT

  1. The controller is defined.
  2. The controller is Namespaced.
  3. The is no route defined in the web.php
 {!! Form::open(['action' => 'ContractorPortal\[email protected]_update', ['id'=>$id] ]) !!}

*Controller: *

 public function password_update(Request $request,$id){

        $user = User::find($id);
        $new_password = $request->new_password;
        $user->password = $new_password;
        $user->save();

        flash::success('Password has been updated');
        return view('portal/contractor_account');
    }

2nd March, 2017

vincej left a reply on Upgrading To 5.4: Why Does Laravel Invent It's Own Urls ?? !! • 4 weeks ago

throughout my app I use resourceful routing. The redirect:

 return 'portal/contractor_account';

opens a view containing the following route:

includes an open::form{{ ['route' =>'contractor_account.update']}}

This is where the "Update" was coming from.

Notice there is no model specified. L5.1 did not seem to worry about this. My app worked fine as within the 'update' controller I grabbed the model id using a $request->id

However, within L5.4 and Collective 5.4 things are a bit more strict, as @Snapey has pointed out to me in another question I posted this pm.

So as part of the upgrade, I need to go through my app and update all the routes.

I've learned a big lesson about Laravel: if you do not have to, do not stay on LTS issues. Trying to upgrade 3 versions in 1 hit is just too painful. Better to keep up.

As always MANY THANKS !

vincej left a reply on Upgrading To 5.4: Why Does Laravel Invent It's Own Urls ?? !! • 4 weeks ago

Many thanks to all. Whilst no specific answer gave me the specific solution, one way or another all of your contributions helped me identify the problem and fix it.

Thanks !

vincej started a new conversation L5.4 Upgrade From 5.1 : Why Does Collective Not Work ? • 4 weeks ago

I've just upgraded fro 5.1 to 5.4. Everything worked in 5.1, however, now I find that when I use Resourcefull routing, collective does not work. My service providers and aliases are up to date. I have upgraded by collective to 5.4 and done a composer update:

{!! Form::open(array( 'route'=>'crews.destroy', 'method'=>'delete')) !!}

Route:

Route::resource('crews','CrewsController');

However, if I change my route to a get, and a url in the view then it all works again. I don't want to have to upgrade my whole app as a result.

What gives ? Thanks !!

1st March, 2017

vincej left a reply on Upgrading To 5.4: Why Does Laravel Invent It's Own Urls ?? !! • 4 weeks ago

@cviv Thanks for that. Nope, the route really is defined there with a "get".

28th February, 2017

vincej left a reply on Upgrading To 5.4: Why Does Laravel Invent It's Own Urls ?? !! • 4 weeks ago

@jimmck Thanks for that Jim. Any ideas why L5.4 invents a url called "portal.contractor_account.update". The update part does not exist. I am guessing that it has something to do with automatic resource routeing.

I tried forcing a route with a "get" but L5.4 just ignored it.

Trying to upgrade from 5.1 to 5.4 though composer was hopeless, so I installed a wholly fresh 5.4 and loaded it with my app. Is it possible that there is some kind of application caching going on? I did a artisan clear:routes to no avail.

5.4 seems to have a mind of it's own. So far it has been a real pain.

Thanks for your help.

vincej left a reply on Getting Login Error Since Upgrade To 5.4 • 4 weeks ago

Good point, thanks ! However, since your reply I have a new problem, which I have written up under a new question.

5.4 is creating it's own url's https://laracasts.com/discuss/channels/laravel/upgrading-to-54-why-does-laravel-invent-its-own-urls

I hate 5.4. Nothing works the way you expect it.. Everything under 5.1 was straight forward and worked. Taylor is getting too clever for his own good. He abstracts everything and as a user, I have no idea why things are doing what they are going and where things are. Ugh.

vincej started a new conversation Upgrading To 5.4: Why Does Laravel Invent It's Own Urls ?? !! • 4 weeks ago

Everything worked great in 5.1 - now I don't understand what is going on.

Within the Logincontroller I have a function:


 protected function redirectTo()
    {
        $id=Auth::id();
        $user = User::find($id);
        if($user->user_group == '0') {
            return '/dashboard';
        }
       return 'portal/contractor_account';

    }

If I am returning to the '/dashboard' it decides that it will go to 'Home'.

Crazier still, if I have a user which needs to return to 'portal/contractor_account' Laravel decides that it will invent it's own URL :

Route [portal.contractor_account.update] not defined.

NO Where have I specified an "update" route ! Why is 5.4 taking control over my app like it's Microsoft ?

Second question - where in the heck are all the routes stored from Route::Auth(); ??

vincej left a reply on Getting Login Error Since Upgrade To 5.4 • 4 weeks ago

You Got it !! Many Thanks !!! It works !!

vincej left a reply on Getting Login Error Since Upgrade To 5.4 • 1 month ago

I'm 99% sure. I commented it out and relied upon the default

$protected $redirectTo = '/dashboard';

and I do not get an error. Of course, I also don't get any redirects on user group either.

vincej started a new conversation Getting Login Error Since Upgrade To 5.4 • 1 month ago

I am upgrading from 5.1 to 5.4. My 5.1 login code worked well. Within the new LoginController I need to redirect to a different location depending upon the user group. Under 5.4 I am getting this error, which I do not know what to do with. Any advice is very appreciated ! Many thanks !!

ErrorException in Response.php line 380: Header may not contain more than a single header, new line detected

    {
        $id=Auth::id();
        $user = User::find($id);
        if($user->user_group == '0') {
            return redirect('/dashboard');
        }
       return redirect('portal/contractor_account');

    }

14th February, 2017

vincej left a reply on Need Advice On Looping Over Array • 1 month ago

@mikefolsom thanks for this. I have rethought my DB table. I had it my head that I would get all the data out of a single table with a single $key=>$value pair. Your advice has set me on the right path.

13th February, 2017

vincej started a new conversation Need Advice On Looping Over Array • 1 month ago

Been working on this for hours with no success. All advice is super welcome !

First off the controller FYI - I have tried with and without toArray:

 public function get_project($id){  

      $project =  Project_template::where('project_id',$id)->get();

      $project ->toArray();

      $n = count($project);

      return view ('quotations.project_edit', compact('n','project'));
    }

So the resulting $projectarray looks like this when I do a dd(). My array can multiple entries.

Collection {#443 ▼
  #items: array:2 [▼
    0 => Project_template {#444 ▼
      #table: "project_template"
      #primaryKey: "id"
      #guarded: array:1 [▶]
      #dates: array:1 [▶]
      +timestamps: true
      #connection: null
      #perPage: 15
      +incrementing: true
      #attributes: array:16 [▼
        "id" => "5"
        "project_id" => "2"
        "squares" => "1786"
        "product_id" => "8769"
        "quantity" => "12"
        "line_cost" => "312.00"
        "subtotal" => "447.60"
        "discount" => null
        "discount_value" => "0.00"
        "netofdiscount" => "447.60"
        "gst" => "22.38"
        "total" => "469.98"
        "comment" => " "
        "created_at" => "2017-02-08 14:29:36"
        "updated_at" => "2017-02-08 14:29:36"
        "_token" => null
      ]
      #original: array:16 [▶]
      #relations: []
      #hidden: []
      #visible: []
      #appends: []
      #fillable: []
      #dateFormat: null
      #casts: []
      #touches: []
      #observables: []
      #with: []
      #morphClass: null
      +exists: true
      +wasRecentlyCreated: false
    }
    1 => Project_template {#445 ▶}
  ]
}


In my Blade view I can see individual entries like this:

 {{print_r($project[0]->squares)}}

My Problem Because I multiple rows are coming off the DB I need to loop over the array. I have a form which needs to be populated. I need to create an unordered list with all the values from the DB lookup.

I have tried this:

@if(!empty($n))         // this is the count of the array $project
        @for($i = 0; $i < $n; $i++)
             @foreach($project[$i] as $k=>$v)
              
                 @foreach($k as $x=>$y)     //**ERROR HERE** "Invalid argument supplied for foreach()" 
                  <p>{{$x}}{{$y}} </p>
                 @endforeach

            @endforeach
        @endfor
    @endif

Needless to say, I have tried innumerable permutations of the foreach loop, all to no avail.

What am I doing wrong ??

Many thanks !

10th February, 2017

vincej left a reply on How To Call A Controller From Ajax And Send A Variable To A View • 1 month ago

@KamalKhan Thank you for the clarified instructions. I have followed them very carefully however, I could not make your solution work. I tried every imaginable permutation without success. Essentially I can not get the partial to successfully pass through the AJAX success function. I can get the $project data to pass through but only if I stringify it inside Ajax.

If I have made an error, then I am sorry. I am not the best at using Ajax.

@jlrdw Thank you for the revised recommendation. I am going to have a crack at that now.

vincej left a reply on How To Call A Controller From Ajax And Send A Variable To A View • 1 month ago

@KamalKhan Thanks, however to be honest I struggled to understand the specifics of your suggest. I took your suggestion below, as a recommendation to also do it inside the Ajax success function.

Return that view to the ajax call so you will receive the final form html in the ajax success function. Finally add the html into your DOM.

vincej left a reply on How To Call A Controller From Ajax And Send A Variable To A View • 1 month ago

@jlrdw @KamalKhan Thanks for all your contributions!

As I expected everyone is telling me I have to return the data through either the JS or Ajax function. I was hoping that I could have returned an array and looped over it inside the view. I don't mind using JS, it's just that the next step involving being to edit the data in the form and then submit it back to the DB. That is using easier when it is in pure php rather than js.

@Cronix tried your suggestion, didn't work. BTW ... are you the very same Cronix of Codeigniter forums fame? The guy with the streaky picture ?

9th February, 2017

vincej started a new conversation How To Call A Controller From Ajax And Send A Variable To A View • 1 month ago

Using 5.1

I have an Ajax function which when it fires, it passes an id to a controller:

Controller:

 public function get_project($id) { 

      $project =  Project_template::where('id',$id)->get();
       return $project;
    }

I can see the data as a Json string in my view if I do this:


        $.ajax({
            url: "get_project/" + id,
            dataType: "json",
            type: "GET",
            success: function (data) {

                {
                    $('#test').append(JSON.stringify(data))  / I can see the data in my view
                }

                 console.log(data[0].squares)  I can isolate individual values like this. 


            }
        })

Sample JSON String

[{"id":"2","project_id":"1","squares":"1234","product_id":"123","quantity":"12","line_cost":"632.04","subtotal":"8387.64","discount":null,"discount_value":"0.00","netofdiscount":"8387.64","gst":"419.38","total":"8807.02","comment":" ","created_at":"2017-02-08 14:27:07","updated_at":"2017-02-08 14:27:07","_token":null}]

Problem: My view is a Form with many rows. I need to be able to loop over the data and input the data into the correct input fields for editing and later submission. So to that end I was expecting to pass the data to the view as an array.

I have been trying to have my controller simply return the data to the view in the normal manner. But that does not work. All I get is a 500 error.

Example:

 public function get_project($id) { 

      $project =  Project_template::where('id',$id)->get();
       return view('quotations/project_edit',compact('project'));
    }

Ok, I suppose I could create and loop over a form inside the Ajax call and append it, but to me that is really messy.

I have been killing myself over this for hours.

I would be so happy with any recommendations.

Many thanks !!

6th February, 2017

vincej left a reply on Can't Get Authentication To Work For Me. • 1 month ago

yes I will upgrade to 5.4 at some point soon. Time is against me right now. :o)

vincej left a reply on Can't Get Authentication To Work For Me. • 1 month ago

@jlrdw THANK YOU !!!! It worked ! You are a Rock Star !

vincej started a new conversation Can't Get Authentication To Work For Me. • 1 month ago

Using Laravel 5.1 And 'Out of the Box' authentication

I have discovered that my application is not logging out a user when I click "logout" ie I can go back into a protected page. I have doubled checked that my controllers are using

$this->middleware('auth');

So, looking into:

 public function getLogout(){
     
        return view('auth/login');
    }

I notice that it has no way of flushing the session. So I add,

    Auth::logout();
     Session::flush();

It will then work correctly until I change the login name, then if I do I get the error:

TokenMismatchException in VerifyCsrfToken.php line 53:

I have checked that my login page does contain the value:

{!! csrf_field() !!}

And I can see it in the view source

I have googled and checked the docs many times. But can not figure out what is going here.

Any advice would be SUPER welcome.

Many Thanks !!

31st January, 2017

vincej left a reply on Need Some Advice On Saving A Ajax Form Data Into L5 • 1 month ago

@nolros Thanks - I always appreciate your help. I will try to remember that.

25th January, 2017

vincej left a reply on Need Some Advice On Saving A Ajax Form Data Into L5 • 2 months ago

@jlrdw @Snapey @ccarver @DarkRoast

I want to thank all four of you guys for taking the time out of your day to help people like me. Without you guys, people like me would probabaly give up. I'm not totally inexperienced. I've done about 18 months on Laravel, 2 years on Codeigniter and about 18 months on pure php. So about 5 years altogether. Still I make mistakes.

Ok - so it looks like I have found the problem. It was never with the AJAX, but rather within the Abreviated controller, which of course you guys could not wholly see. I follwed snapey's advice and checked the XHR and saw the data going out. But I kept getting a '500' error which is nearly always a DB or a controller error. So I stripped my controller down to 2 values to save and bingo, success.

So now I will rebuild the controller untill it fails and I find the error.

Yes, I know I should install Xdebug in my PHPStorm. I have tried now 2 times and failed each time to get it to work. It's either me of the terrible docs. Time is always against me and so spending another 2 hours fighting with Storm fills me with dread.

I have to use Ajax to submit a form on a click for the reason that my form contains js generated rows and a simple html submit doesn't work. ccarver - I wil try your suggesting of using a submit.

Many thanks to all !!!

24th January, 2017

vincej left a reply on Need Some Advice On Saving A Ajax Form Data Into L5 • 2 months ago

@ccarver thanks for your help. to answer your question, when I use dd(request()->all()); I get nothing.

vincej left a reply on Need Some Advice On Saving A Ajax Form Data Into L5 • 2 months ago

@snapey my consol log shows the serialized values of the form. So I am assuming my Ajax is good.

vincej left a reply on Need Some Advice On Saving A Ajax Form Data Into L5 • 2 months ago

@jlrdw Thanks for helping out. As suggested, I removed the datatype:jason and It's still not woking. Any more ideas ?

cheers !

23rd January, 2017

vincej started a new conversation Need Some Advice On Saving A Ajax Form Data Into L5 • 2 months ago

I'm making a mistake somewhere but I can't see it. Essentially my Ajax function works. But I can't get it into my controller for saving into my DB. I have tried using What am I doing wrong ?

Many Thanks !

```

$("#editsubmit").click(function () { event.preventDefault();

            var formData = $("form").serialize();

            $.ajax({
                headers: {'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content')},
                type: "POST",
                url: 'save_edit',    
                dataType: 'json',
                data: formData,
                success: function () {

                    console.log(formData);   // GETTING A RESULT HERE. 

                    localStorage['alert'] = 'true';
                    location.href = "http://auburntree/open_quotes"
                },
                error: function () {
                    alert('there has been a system level error - please contact support')
                }
            });
        
    });
Controller ( Abreviated)  : 

public function save_quote_edited(Request $request){

       $newQuotation = new Quotation();
        $newQuotation->discount = $request->get('discount');
        $newQuotation->discount_value = round($request->get('discountvalue_hidden',2)); 
        $newQuotation->netofdiscount = $request->get('netofdiscount_hidden');
        $newQuotation->gst = $request->get('gst_hidden');
        $newQuotation->total =  round($request->get('final_total_hidden',2));                                  
        $newQuotation->save();

}



18th January, 2017

vincej left a reply on Snappy / Wkhtmltopdf: How To Change The Default Save Folder ? • 2 months ago

Ok, found answer. I hope this helps someone else.

            $quotation = $this->quotation->get_PdfQuote($ref);  //pulled in from DB
            $pdf = PDF::loadView('quotations/pdf_quotation',compact('quotation') );

            $filename = base_path('public/pdf/'.$ref.'.pdf');
            $pdf->save($filename);

17th January, 2017

vincej left a reply on How To Format 'Created_at' In Blade Using Carbon • 2 months ago

Thank you both for coming back ! You are both correct, however I gave the reward point to @SaeedPrez only because he was first.

And Yes - I am using query builder only becauee I have to join 2 tables.

Thanks !

vincej started a new conversation How To Format 'Created_at' In Blade Using Carbon • 2 months ago

I have been Googling and trying different recomentations here on Laracasts but without success. Essentially, Carbon formating needs to see an object, but my data is coming off the DB as an array:

array:1 [▼
  0 => {#340 ▼
    +"reference": "Joh170117-61"
    +"quote_name": ""
    +"lead_product": ""
    +"total": "134.34"
    +"job_address": ""
    +"job_city": ""
    +"start_date": "Tue Feb 21"
    +"created_at": "2017-01-17 16:22:44"
    +"company_name": "Private Sale"
    +"firstname1": "Jill"
    +"lastname1": "Johness"
    +"telephone1": "4036853105"
    +"address": "151 Auburn Place"
  }
]

So what can I do to get the created_at date reformated into d/m/Y in Blade ?

Many thank !

vincej left a reply on Snappy / Wkhtmltopdf: How To Change The Default Save Folder ? • 2 months ago

@vektorstudio Hi, Thanks for that. I did see that post, but I'm completely flumexed how to use this:

wkhtmltopdf [OPTIONS]... <input file> [More input files] <output file>

I don't have an input file, it is being generated by L5 like this:

 $quotation = $this->quotation->get_PdfQuote($ref);
            $pdf = PDF::loadView('quotations/pdf_quotation',compact('quotation') );
            $pdf->save($ref.'.pdf');

           $title = 'Customer Quotation';
           $firstname =  $customer['firstname1'];
           $pathtoFile = '/var/www/mysite/public/'.$ref.'.pdf';


           Mail::send('emails.quotation', ['title' => $title, 'firstname'=>$firstname ], function ($m) use($customer,$pathtoFile)  {
                $m->from([email protected]', 'My App');

                $m->to($customer['email1'],($customer['firstname1'] . $customer['lastname1']))->subject('Your Roofing Quotation');

                $m->attach($pathtoFile);
            });

vincej started a new conversation Snappy / Wkhtmltopdf: How To Change The Default Save Folder ? • 2 months ago

Everything is working for me, however it is saving the pdf's into the Public folder. I want to give it a different folder. Looked at the docs and I can see nothing on how to do that.

Any ideas ?

Many thanks !

13th January, 2017

vincej left a reply on How To Include An Image Into PDF Using Barryvdh / Snappy • 2 months ago

Success !!! @jlrdw was on the right track - finding the correct paths can be tricky. in the end I found this Stackoverflow post who recommended using the Linux command pwd after having cd'ed through the consol to the img folder. That gave me the correct path. Also it is a good thing to check the ownship of the images as well as the img folder.

I hope this helps someone else.

http://stackoverflow.com/questions/16627310/wkhtmltopdf-not-loading-local-css-and-image

vincej left a reply on How To Include An Image Into PDF Using Barryvdh / Snappy • 2 months ago

Actually, you can only get tp the config file through the command line. There is no laravel like config file. But, I found the correct command. Thanks !

vincej left a reply on How To Include An Image Into PDF Using Barryvdh / Snappy • 2 months ago

@jlrdew

Thanks for that - do you know how to get into the wkhtmltopdf settings? They are accessible through the command line, but I can not find the command. The docs and attrocious imho.

vincej left a reply on How To Include An Image Into PDF Using Barryvdh / Snappy • 2 months ago

@jlrdw @andreich1980

I forget to mention that I can see the image in the HTML template.

vincej left a reply on How To Include An Image Into PDF Using Barryvdh / Snappy • 2 months ago

@andreich1980 Thanks for the feedback - but that did not work either. Tried .gif, .png, and .jpeg.

12th January, 2017

vincej left a reply on How To Include An Image Into PDF Using Barryvdh / Snappy • 2 months ago

@jlrdw No, it the img is in the same folder as where I create the blade template. If the PDF is created in a different folder, I would not know where that it.

Moreover, I do not know how to access the wkhtmltopdf options. You get to then through the terminal somehow. The docs are not the best.

vincej started a new conversation How To Include An Image Into PDF Using Barryvdh / Snappy • 2 months ago

Everything is working except the ability to include an image. So far I have created a dedicated blade template for the creation of PDF's and so have been using standard HTML for that job. Hence I have used:

<img src="angels_white_small.gif ">

The image is in the same folder as the pdf template, so there should be no url problems. Indeed Storm finds it immediately.

But all I am getting is a little square on my pdf typical of a missing image.

I have checked the snappy config file and it looks ok:

 'image' => array(
        'enabled' => true,
        'binary'  => '/usr/local/bin/wkhtmltoimage-amd64',
        'timeout' => false,
        'options' => array(),
        'env'     => array(),
    ),

The default in wlhtmltopdf is to allow images.

So - any ideas why things aren't working ?

many thanks !

vincej left a reply on Error 127 When Trying To Run Barry Vdh Snappy PDF Wrapper • 2 months ago

@ejdelmonico Thanks for that ! Yes, I put it into the config. It's all working !

Now I have different challenge. I have discovered that Snappy does not like absolute paths. Yet, this is what Laravel 5 generates in your header like this:

<script src="http://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>

// or

 {!!Html::script('js/tabs.js') !!}

So - it occures to me that when using Snappy you have to create a new blade template which is void of all these paths. You can not just grab the existing blade view and convert to PDF. You need an intermediate blade view.

Do you agree ?? Or have I got something wrong here ?

Many thanks !

vincej left a reply on Error 127 When Trying To Run Barry Vdh Snappy PDF Wrapper • 2 months ago

Ok - I have it working but I have now a new question. I will post a new question on Laracasts.

vincej left a reply on Error 127 When Trying To Run Barry Vdh Snappy PDF Wrapper • 2 months ago

@ejdelmonico Ok - I assume that 'binary' => '/usr/local/bin/wkhtmltopdf-amd64', refers to the snappy config file in the vendor folder.

vincej left a reply on Error 127 When Trying To Run Barry Vdh Snappy PDF Wrapper • 2 months ago

Thank you for your help ! When I say I use Linux, I mean, my dev machine runs Linux, no Vagrant to be seen.

Ok, I did the cp vendor x2 and I did the chmod x2 and it looks like progress has been made, as the original error message is gone. But I have a new error message, below. This could to do with the fact that I have done nothing with

'binary'  => '/usr/local/bin/wkhtmltopdf-amd64',

as I have no idea what do with that. Can you please elaborate ?

New Error Message:

RuntimeException in AbstractGenerator.php line 336:
The exit status code '1' says something went wrong:
stderr: "Loading pages (1/6)
[> ] 0%
[======> ] 10%
[=======> ] 13%
[===============> ] 25%
[==================> ] 30%
[======================> ] 37%
[=========================> ] 42%
[===========================> ] 46%
[============================> ] 48%
[========================================> ] 67%
[============================================> ] 74%
[============================================================] 100%
Counting pages (2/6) 
[============================================================] Object 1 of 1
Resolving links (4/6) 
[============================================================] Object 1 of 1
Loading headers and footers (5/6) 
Printing pages (6/6)
[> ] Preparing
[==============================> ] Page 1 of 2
[============================================================] Page 2 of 2
Done 
Exit with code 1 due to network error: ProtocolInvalidOperationError
"
stdout: ""
command: /usr/local/bin/wkhtmltopdf-amd64 --lowquality '/tmp/knp_snappy5877be22981922.40588793.html' '/tmp/knp_snappy5877be22981ff1.99742632.pdf'.

11th January, 2017

vincej left a reply on Error 127 When Trying To Run Barry Vdh Snappy PDF Wrapper • 2 months ago

I use linux. I have assumed that the directions offer for vagrant users apply to Linux users.

No - I have not changed the permissions. I will try it tomorrow morning.

vincej started a new conversation Error 127 When Trying To Run Barry Vdh Snappy PDF Wrapper • 2 months ago

Here is the error:

The exit status code '127' says something went wrong:
stderr: "sh: 1: /usr/local/bin/wkhtmltopdf: not found
"
stdout: ""
command: /usr/local/bin/wkhtmltopdf --lowquality '/tmp/knp_snappy5876d48ed090d7.94578774.html' '/tmp/knp_snappy5876d48ed095e2.25553761.pdf'.

I found this discussion on this topic on Barry's github:

https://github.com/barryvdh/laravel-snappy/issues/68

I hav efollwed all the advice given, including the detailed install instructions given in that discussion:

https://thajegan76.wordpress.com/category/laravel/

This seems to be a common problem.

Any ideas ???

Thanks !

vincej left a reply on DOMPDF Error: Non Static Method Should Not Be Called Statically. • 2 months ago

Ok - I fixed the fonts folder problem. Then I had a xdebug nested maximum =100 problem. Fixed that too. Now I just have to get my data into a reasonable format !

Thanks !

vincej left a reply on DOMPDF Error: Non Static Method Should Not Be Called Statically. • 2 months ago

Interesting - the "static" problem has gone away. Thanks ! However, suriously, I was using use Barryvdh\DomPDF;

Ok - progress, now I have a new error:

fopen(/var/www/auburntree/storage/fonts//46f447491707b1fce3177e2aa6be2392.ufm): failed to open stream: No such file or directory

I did previously download GD.

vincej left a reply on DOMPDF Error: Non Static Method Should Not Be Called Statically. • 2 months ago

added this to the aliases in the App / config folder

  'PDF'       => Barryvdh\DomPDF\Facade::class,

Looks right to me.

Edit Your Profile
Update

Want to change your profile photo? We pull from gravatar.com.