Closed ahmadnakouzi closed 1 month ago
Hi @ahmadnakouzi
Let me look into it. I will give you feedback soon!
Kind regards, Ismael
I faced the same issue and fixed it temporary by changing two things the file vendor/ismaelw/laratex/src/LaraTeX.php on my server.
Add line: use Illuminate\Support\Facades\Event;
Event:: instead of \Event:: on line 221
I hope we can find a better solution.
I faced the same issue and fixed it temporary by changing two things the file vendor/ismaelw/laratex/src/LaraTeX.php on my server.
Add line: use Illuminate\Support\Facades\Event;
Event:: instead of \Event:: on line 221
I hope we can find a better solution.
Hi @baseljd
I read something about facade changes in Laravel 10. So your temporary bugfix is probably the correct fix for it. I will implement this and create a new release.
Kind regards, Ismael
I have tried the temporary changes mentioned above, but I'm still facing a new issue: sh: line 0: exec: pdflatex: not found.
so don't think it is the solution
so don't think it is the solution
Hi @ahmadnakouzi
Thank you for your message. I guess this issue is another one. What system are you running your laravel application on? Windows or Linux? Do you have access to the console? If yes, can you run pdflatex directly without passing the path to the executable?
Hi @ismaelw locally using MacBook (doesn't work with the temporary fixes) Server using Linux Ubuntu (worked with the temporary fixes mentioned above)
Hi @ismaelw
locally using MacBook (doesn't work with the temporary fixes)
Server using Linux Ubuntu (worked with the temporary fixes mentioned above)
On your MacBook in terminal, if you just type in pdflatex and press enter - does it run pdflatex? If not then maybe you have to pass the absolute path to your pdflatex installation. And if that is the case - you would have to add the absolute path to the binPath setting in the config file of LaraTeX
@baseljd @ahmadnakouzi
The bug fix is implemented and a new release 1.2.4 has been created. @ahmadnakouzi For further support on your local machine using MacOS please provide more details on my question in my other comment.
Kind regards, Ismael
Hello @ismaelw Thanks for your fast response.
Alright, I will check it on my server.
I have tried running pdflatex locally on my MacBook and here is the result.
Hello @ismaelw Thanks for your fast response.
Alright, I will check it on my server.
I have tried running pdflatex locally on my MacBook and here is the result.
Hi @ahmadnakouzi
I just remember something. I had a similar issue in my Windows machine. What I did realize is, that for whatever reason, my PHP PATH environment variable was not the same as my local PATH environment variables. Therefore the webserver was not able to find the pdflatex executable.
What I ended up doing was moving the pdflatex Path from my config file to the .env file and referencing that env Variable in my config file so that I can have a workaround on my local machine but still use the normal "pdflatex" setting in my production environment on my linux server.
Config file:
<?php
return [
// bin path to your pdflatex installation | use 'which pdflatex' on a linux system to find out which is the path to your pdflatex installation
'binPath' => env('LATEX_PATH', ''),
// Folder in your storage folder where you would like to store the temp files created by LaraTeX
'tempPath' => 'app/temp/',
// boolean to define if log, aux and tex files should be deleted after generating PDF
'teardown' => true,
];
.env file:
LATEX_PATH=/absolute/path/to/pdflatex
Can you try locally what happens if you (not using the .ENV file just yet) pass the absolute path to pdflatex on your MacBook to see if that would work? Also to check, can you verify this in your PHP installation? You could just create a phpinfo();
page to check if the PATH variable contains the path to the pdflatex executable.
Hi @ahmadnakouzi
Have you been able to test and troubleshoot your other issue?
Kind regards, Ismael
After installing texlive-full and the laratex package, I'm facing the following issue when calling this function:
function:
public function laraTexTest() { return (new LaraTeX)->dryRun(); }
Error:
Class "Event" not found in file /var/www/app/vendor/ismaelw/laratex/src/LaraTeX.php on line 221
laravel version: 10 PHP version: 8.2