📌  相关文章
📜  如何在 laravel 中将数据传递给控制器 - PHP 代码示例

📅  最后修改于: 2022-03-11 14:53:43.742000             🧑  作者: Mango

代码示例1
$dept = DB::table('master_department')->get();
$design = DB::table('master_designation')->get();
return view('registration', ['dept' => $dept], compact('design'));

#if we send as array
@foreach($dept as $key=>$d)
    {{ $dept[$key]->dept_title }}
@endforeach

#if we send as compact object
@foreach($design as $deg)
                                
@endforeach