2016-08-10 05:24
浏览 74

如何从laravel 5.2中的数据库中获取值到过滤器搜索的下拉列表

I am doing project in laravel 5.2, for report creation in "vehicleDetail.blade.php" i need to give one drop down option, in that i need to get vehicle names which are there in the database. From that list if i select one vehicle, select fromDate , toDate and then click on generate report i should be able to fetch data from the database (device table). For this filter engine how can i make the drop down list byb fetching data fro the database?



    <div class="templatemo-content-wrapper">
        <div class="container">
            <ol class="breadcrumb">
                <li><a href="{{ url("/") }}"><font color="green">Home</font></a></li>
                <li class="active">Vehicle Detail</li>
            <div class="row">
                <div class="col-md-8 col-md-offset-2">
                    <div class="panel panel-success">
                        <div class="panel-heading">Vehicle Detail</div>
                        <div class="panel-body">
                            @if (count($errors) > 0)
                                <div class="alert alert-danger">
                                    <strong>Whoops!</strong> There were some problems with your input.<br><br>
                                        @foreach ($errors->all() as $error)
                                            <li>{{ $error }}</li>

                            <form class="form-horizontal" role="form" method="POST" action="{{ url('group/update/') }}">
                                <input type="hidden" name="_token" value="{{ csrf_token() }}">

                                    <div class="form-group">
                                        <label class="col-md-4 control-label">Vehicle</label>
                                        <div class="col-md-6">

                                            <input type="text" class="form-control" name="groupID" value="{{ ('#')}}">


                                    <div class="form-group">
                                        <label class="col-md-2 control-label">From Date</label>
                                        <div class="col-md-6">
                                            <input type="date" class="form-control" name="Fdate">

                                        <label class="col-md-4 control-label">To Date</label>
                                        <div class="col-md-6">
                                            <input type="date" class="form-control" name="Tdate" >

                                    <div class="form-group">
                                        <div class="col-md-6 col-md-offset-4">
                                            <button type="submit" class="btn btn-warning">
                                                Get Report


Any one please help me to do this, response are appreciable.

  • 写回答
  • 好问题 提建议
  • 追加酬金
  • 关注问题
  • 邀请回答

1条回答 默认 最新

相关推荐 更多相似问题