Get the App
SLTechnology News&Howtos  ›  Servers  › 

Laravel5.4 about select drop-down box reading database data case

Shulou Source: shulou.com Published: 2022-06-02 09:57:11 09月28日 Update

First, you need to make a select down box.

= = Top level category = @ foreach ($data as $d) {{$d-> cate_name}} @ endforeach

And then the background reads the data.

Public function create () {$data = Category::where ('cate_pid',0)-> get (); return view (' category/add',compact ('data'));}

It should be easy for everyone to understand! No explanation!

Tags: Data background that is top level classification interpretation database case drop-down Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Shulou Information macOS Huawei OPPO Reno Xiaomi