Differences
This shows you the differences between two versions of the page.
Both sides previous revision Previous revision | Next revisionBoth sides next revision | ||
getting_started_with_laravel [03.12.2020 16:10] – [Form validation] Pascal Suter | getting_started_with_laravel [04.12.2020 11:16] – [Create Model + Controller + Migration all in one step] Pascal Suter | ||
---|---|---|---|
Line 190: | Line 190: | ||
===== Tricks ===== | ===== Tricks ===== | ||
+ | ==== dump / dump and die ==== | ||
+ | this has to be the first tip :) .. there is a helper function called '' | ||
+ | |||
+ | you may not always want to stop the execution, so another helper called '' | ||
+ | |||
+ | the latter is especially helpful when dumping variables in a blade. however, if you use | ||
+ | < | ||
+ | {{ dump($__data) }} | ||
+ | </ | ||
+ | for example to get a dump of all defined variables in your blade, you are going to run into a laravel error which tells you that htmlspecialchars only works with strings but got something else (an array most likely).. | ||
+ | |||
+ | so to use dump in a blade, you can use a blade syntax '' | ||
==== Create Model + Controller + Migration all in one step ==== | ==== Create Model + Controller + Migration all in one step ==== | ||
artisan make:model Pizza -mc | artisan make:model Pizza -mc |