首页 > 解决方案 > 根据食物搜索特定餐厅

问题描述

我有一个搜索输入,用户应该在其中搜索以便返回结果

<div class="field" id="searchform">

        <input type="text" id="searchterm" placeholder="e.g mutton 

        karahi,pizza..."  />

        <button type="button" id="search" 

        onclick="window.location='http://localhost:8000/search'">Find Food!</button>

        </div>

食物项目位于名为 foods 的表中,该表具有以下字段

$table->bigIncrements('id');
            $table->timestamps();
            $table->integer('price');
            $table->string('food_item')
            $table->integer('restaurant_id');
        });

对于食物表获取 restaurant_id 的餐厅来说,这是一个不同的表

怎么办

标签: laravel

解决方案


推荐阅读