Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/php/283.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Laravel的日期选择器(blade.php) 目标:_Php_Laravel - Fatal编程技术网

Laravel的日期选择器(blade.php) 目标:

Laravel的日期选择器(blade.php) 目标:,php,laravel,Php,Laravel,我试图制作一个表格,显示数据库中每个人的可用性布尔值,从而可以选择要检查的日期范围 我是如何努力做到这一点的 我目前有一个带有@foreach循环的表,它将遍历$period=new CarbonPeriod$start\u date,$end\u date中的所有日期 $start_date和$end_date取自datepiker 问题是什么? 我曾尝试使用JS制作日期选择器,但我无法将JS中的值传递给blade,这意味着我无法与Carbon进行比较,也无法使用blade进行@foreach

我试图制作一个表格,显示数据库中每个人的可用性布尔值,从而可以选择要检查的日期范围

我是如何努力做到这一点的 我目前有一个带有@foreach循环的表,它将遍历$period=new CarbonPeriod$start\u date,$end\u date中的所有日期

$start_date和$end_date取自datepiker

问题是什么? 我曾尝试使用JS制作日期选择器,但我无法将JS中的值传递给blade,这意味着我无法与Carbon进行比较,也无法使用blade进行@foreach

代码: 表: 日期选择器: 我试图使用JS datepicker,但无法将值从它传递到blade.php以运行@foreach循环

其他次要问题: 我无法使左边的4列保持粘性,而不将其中一列置于另一列之上

<table class="table">
    <thead class="sticky-header">
        <tr>                        
            <th class="fixed-position-left px-4 py-2">ID</th>
            <th class="fixed-position-left px-4 py-2">Name</th>
            <th class="px-4 py-2">Building</th>
            <th class="px-4 py-2">Job</th>
        
            {{-- This will be a foreach dates in a range selected with a datepicker --}}
            @foreach (range(1, 16) as $index)
                <th class="px-4 py-2">1/01/2020</th>
            @endforeach
            
            <th class="sticky-coulmn-right px-4 py-2">Actions</th>
        </tr>
    </thead>
    <tbody>
        {{-- This will be all users in the database --}}
        @foreach (range(1, 24) as $index)
            <tr>
                    <td class="sticky-coulmn-left border px-4 py-2">1</td>
                    <td class="sticky-coulmn-left border px-4 py-2">Jhon Smith</td>
                    <td class="border px-4 py-2">1</td>
                    <td class="border px-4 py-2">Software Developer</td>

                    {{-- This will be a foreach dates in a range selected with a datepicker --}}
                    @foreach (range(1, 16) as $index)
                        <td class="border px-4 py-2"></td>
                    @endforeach
                
                <td class="sticky-coulmn-right border px-4 py-2">
                    <button type="submit" class="bg-green-500 rounded-full shadow py-1 px-2 text-white ">
                        <i class="fas fa-pencil-alt"></i>
                    </button>
                    <button type="submit" class="bg-red-500 rounded-full shadow py-1 px-2 text-white ">
                        <i class="far fa-trash-alt "></i>
                    </button>
                </td>
            </tr>
        @endforeach
    </tbody>
</table>