I'm new to Blade and tried to use anonymous components for sections that I will use frequently.
The problem is that when I'm trying to pass down data to the component, it won't show anything.
Here is my Code:
Controller:
public function edit(Workingtime $workingtime)
    {
      $user = User::find(Auth::id());
      $workingtime_array = $user->getWorkingtimesOfThisDay($workingtime->id);
            
      return view('workingtime-edit', compact('workingtime_array', 'workingtime'));     
    }

workingtime-edit.blade.php:
<p>Overview of Workingtimes</p>

@if(count($workingtime_array) > 0)
    <x-workingtime-timeline :workingtimeArray = "$workingtime_array"/>
@endif


workingtime-timeline.blade.php (component):
@props(['workingtimeArray']) 

@php

    if(isset($workingtimeArray) AND count ($workingtimeArray) > 0){
        $start = strtotime($workingtimeArray[0]->time_begin);
        $end = strtotime($workingtimeArray[count($workingtimeArray)-1]->time_end);
    } 

@endphp

@foreach ($workingtimeArray as $worktime)

    <p>Start: {{ $worktime->time_begin }} </p>
    <p>End: {{ $worktime->time_end }} </p>

@endforeach;

When I don't use variables and @props, it shows me the content of the component.
I tried to change the <x-workingtime-timeline :workingtimeArray = "$workingtime_array"/> line but nothing worked.
Things I tried:
<x-workingtime-timeline :workingtimeArray = "$workingtime_array"> </x-workingtime-timeline>
<x-workingtime-timeline workingtimeArray = "$workingtime_array"/>

Blade: anonymous component doesn't show when passing data
In workingtime-edit.blade.php you need to remove the spaces around the = for the attribute you are setting:
<x-workingtime-timeline :workingtimeArray="$workingtime_array"/>

I think this is a limitation of Laravel's parsing of component attributes, since this is not a general requirement of HTML attributes.
