We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Since v9.15, After the merge of this pull request: #42574
<x-slot :name="$language->code">
throws error as undefined constant "code". Because compiled view is looking like this:
<?php $__env->slot($language>code null, []); ?> <?php echo e($language->name); ?> <?php $__env->endSlot(); ?> instead <?php $__env->slot($language->code null, []); ?> <?php echo e($language->name); ?> <?php $__env->endSlot(); ?> Because it's trying to make camel case $language->code
<?php $__env->slot($language>code null, []); ?> <?php echo e($language->name); ?> <?php $__env->endSlot(); ?>
<?php $__env->slot($language->code null, []); ?> <?php echo e($language->name); ?> <?php $__env->endSlot(); ?>
$language->code
create a blade component:
php artisan make:component Test
In any blade file:
(It does not matter content of the x-test component below)
x-test
@php $languages = [ [ 'name' => 'Turkish', 'code' => 'tr' ], [ 'name' => 'English', 'code' => 'en' ] ]; $languagesAsArrayOfObjects = [ (object)[ 'name' => 'Turkish', 'code' => 'tr' ], (object)[ 'name' => 'English', 'code' => 'en' ] ]; @endphp ##Works <x-test> @foreach($languages as $language) <x-slot :name="$language['code']">{{ $language['name'] }}</x-slot> @endforeach </x-test> <br><br> ##Works <x-test> <x-slot name="tr">Turkish</x-slot> <x-slot name="en">English</x-slot> </x-test> <br><br> ###Does not work (undefined constant code) <x-test> @foreach($languagesAsArrayOfObjects as $language) <x-slot :name="$language->code">{{ $language->name }}</x-slot> @endforeach </x-test> <br><br> ##Works <x-test> @foreach($languagesAsArrayOfObjects as $language) @php($code = $language->code) <x-slot :name="$code">{{ $language->name }}</x-slot> @endforeach </x-test>
The text was updated successfully, but these errors were encountered:
Closing this as a PR was opened. Thanks
Sorry, something went wrong.
No branches or pull requests
Description:
Since v9.15, After the merge of this pull request: #42574
throws error as undefined constant "code". Because compiled view is looking like this:
<?php $__env->slot($language>code null, []); ?> <?php echo e($language->name); ?> <?php $__env->endSlot(); ?>
instead
<?php $__env->slot($language->code null, []); ?> <?php echo e($language->name); ?> <?php $__env->endSlot(); ?>
Because it's trying to make camel case
$language->code
Steps To Reproduce:
create a blade component:
php artisan make:component Test
In any blade file:
(It does not matter content of the
x-test
component below)The text was updated successfully, but these errors were encountered: