Add Laravel support to CodeRunner (Tinker in CodeRunner).
Install this package globally via Composer.
composer global require stichoza/laravel-coderunner
- Go to CodeRunner preferences.
- Navigate to Languages tab.
- Right-click on
PHP
and select Duplicate. - Name new language
Laravel
. - Write following in the "Run Command" field:
laravel-coderunner $filename
Note: If you don't have composer path added in your .profile
or .bash_profile
, go to CodeRunner preferences, navigate to Advanced tab and add /Users/YOUR_USERNAME/.composer/vendor/bin
to PATH
shell variable.
By default, the code is evaluated in default Laravel installation that is provided with this package. Follow this steps if you want to run code in different project:
- Assuming you already have Laravel available in CodeRunner, click "Run Settings..." button right next to Run and Stop buttons.
- Enter absolute path to your project in Arguments field.