I have been using Laravel 4 since the start of the year. PHPStorm does not yet support Laravel 4 debugging. Are there any other alternatives?
I have some Artisan command code written in PHP. What is the best tool to debug the code (Single step, set breakpoint, examine values of variables etc)
I use Clockwork https://github.com/itsgoingd/clockwork
You can download the Chrome extension that works in conjunction with it here https://chrome.google.com/webstore/detail/clockwork/dmggabnehkmmfmdffgajcflpdjlnoemp?hl=en
Related
I've used the pry gem in the past to inspect objects in Ruby on Rails. Is there a way to do this in Laravel?
As PRY is more like an attempt for a REPL console..
you should be able use 'php artisan tinker' as REPl to execute and inspect objects.
Not sure if it's installed by default:
https://github.com/laravel/tinker
However inspecting / debuging on itself, you should consider xdebug, with IntelliJ IDE / PHPStorm or any other IDE supporting XDebug.
It gives you many advantages and make debugging and work more effective
I just discovered Laravel Dusk, and I was excited to use it in my project. However, it can't seem to get it to work. I followed the Laravel Documentation to install Dusk. When I run php artisan dusk in the terminal, I get
[Symfony\Component\Process\Exception\RuntimeException]
TTY mode is not supported on Windows platform.
I found this (https://github.com/laravel/dusk/pull/13/files) which is supposed to fix it I think, but I still get the error.
Also, I attempted to run the Dusk tests through PhpStorm following the accepted answer here (https://laracasts.com/discuss/channels/testing/dusk-via-phpstorm), but I get a Class config does not exist error. Many people said that this caused by a space in the .env file, but that is not my issue.
Can anyone help me figure out what is going on with Laravel Dusk in my setup? My Laravel project is 5.4 and I'm using Laravel Dusk 1.0 and PhpStorm is 2017.2.1
You can install chromedriver into windows on your own, and try not to use the version that is shipped with laravel dusk. Remember that, your chromedriver version needs to match your currently installed Chrome version, and when Chrome gets updated, then you need to update/reinstall chromedriver manually again. Hopefully it does not happen too often, and when there are updates, you benefit from using latest versions, which I find really nice :)
Download it here.
After installing chromedriver, you need to start it from command line (just issue command in your download/install directory chromedriver) or add it as service (which I do not prefer, cause I want to have control of which service is running on 9515 port).
Finally you need to comment out // static::startChromeDriver(); in your DuskTestCase.php, which tries to start laravel dusk included chromedriver, cause in this case, you are already running one.
Run dusk tests again and all should be working fine.
I don't know what your system setup is, but I am using this workaround on windows 10 with Laravel 5.5, dusk 2.0, which still causes problems, when chrome gets updated.
BTW. Just to mention. This also works with CI workflows using docker. You can read more about it here
I'm a webdeveloper and I'm starting a huge project requested by a company.
I'm trying to figure out if is best to use a PHP framework or not, and in case, which one.
I know Codeigniter, but I wanted to look around to see what's the best framework at the moment. I found out Laravel is trending at the top so I wanted to try it out.
Being used to Codeigniter I usually download the zip file with all the phps inside and start working. I'm trying to do the same with Laravel but I saw you are to download and use composer to install it.
I'm not really used to the Terminal and I wanted to ask if that's the only way of installing it or if there is a downloadable version as in Codeigniter, CakePHP, etc...
You can always download the ZIPped code directly from project's GitHub site. You can find the base application here: https://github.com/laravel/laravel - you'll find a link at the bottom of the right column. This code is what composer downloads when you use that to setup the application.
If you want to use Laravel you will have to use Composer as this is what the application uses to manage its dependencies. It's not hard, as you'll only need to run a few commands.
You can learn more about how to install and use composer in the docs: https://getcomposer.org/download/
I'm developing an application using Laravel framework and using some packagist / composer packages. Will HHVM be able to handle that, I heard that HHVM doesn't run all php functions or something..
If no, how can I optimize my app to use HHVM without problems?
Laravel is full supported at HHVM, as you can read at the list of supported frameworks.
So if you want to run your application on HHVM you must test your code against HHVM. And take care of the used PHP extensions, the number of extensions supported by HHVM is growing every day, you maybe some are missing.
I've recently installed a fresh copy of Laravel 4.2 for a new project.
I've turned on debugging in app/config/app.php, set up my local environment in bootstrap/start.php and turned debugging on in app/local/app.php.
For some reason, my stack trace pages have changed. I can't find anything about them having officially changed, there's nothing in the upgrade guide...
Here's a screenshot of what it looks like. It's almost like an addition onto the normal "something went wrong" page, not like the orange/grey stack traces I've become used to.
To check, I created a whole new test project and the proper stack trace (albeit a different colour) is displayed, like so.
What's going on?
Just run following artisan command from your command prompt:
php artisan clear-compiled
It supposed to ran after installation (I had same problem).
I'm surprised you two were able to get the problem solved with artisan clear-compiled and composer update alone. Neither of those work for me.
After some troubleshooting, I found there are changes made in Laravel 4.2.2 and 4.2.3 that cause the Whoops page to go wonky. I've opened an issue at github.
Changes introduced in 4.2.2 make the stack traces look like the first #sanaco screenshot...
Laravel 4.2.2:
...then additional changes made in 4.2.3 make it look the second one:
Laravel 4.2.3