Each project has to ability to quickly "Debug" and "Run" in VS Code.
When debugging, the launch.json
is configured to startup PHP's XDebug, launch Laravel, and open Chrome. This may not work on all user environments, however, this is the most common setup.
To debug your Views (.blade.php
), you can insert {{ @xdebug_break() }}
in your HTML to hit a breakpoint when that area of the code is reached.
When hit, you will start at the framework's helpers.php
. From there, press F10 down through to the return ...;
statement, it will then take you to your generated PHP/HTML code.
Generated code can be found in
storage/framework/views/{GUID}.php
.
There are multiple ways to report back Form errors found via the FormController.php
- Using
@if ($errors->any()) ... @endif
to display aDiv
block at the top - Using
@error('fieldName') ... @enderror
to display aSpan
under the input box. - Using
@if ($errors->has('fieldName')) ... @endif
to display aSpan
under the input box