@yaddly You're not doing anything wrong — this is not a bug, but a PHP language rule.
Check details here: https://www.php.net/manual/en/functions.arguments.php#functions.named-arguments
Good day laracons, I encountered a peculiar phenomenon while I was doing a tutorial. I used the include blade directive as below and it throw a fatal error 'Cannot use positional argument after named argument'. However, removing the named arguments resolves the error, however, it makes the code hard to read or nebulous.
Throws Error:
@include(view: 'components.partial-views.input', data: ['input_name' => 'company-name', 'input_id' => 'company-name'])
Simple Fix:
@include('components.partial-views.input', ['input_name' => 'company-name', 'input_id' => 'company-name'])
Is this a bug or there is something genuinely wrong with my code?
Please or to participate in this conversation.