The following controller makes a query to the news table. The search engine makes the query with three different fields. The question is how to make the query from the table (notes) at the same time as the news table. Then show the data in the view.
// public function busqueda(Request $request)
// {
//
// $ntc_turno = $request->input('noticiero_turno');
// if($ntc_turno){
// $noticia = Noticia::where('noticiero_turno','LIKE',"%$ntc_turno%")
// ->orWhere('noticiero_programa','LIKE',"%$ntc_turno%")
// ->orWhere('noticiero_fecha','LIKE',"%$ntc_turno%")
//
// ->paginate(2);
//
// return view('noticia.listar',array('noticia'=>$noticia));
// }else{
// $noticia = Noticia::paginate(3);
// return view('noticia.listar',array('noticia'=>$noticia));
//
// }
//
//
// }
CODE OF VIEW
@extends('layouts.default')
@section('content')
<div class="panel panel-success">
<div class="panel-heading">Buscar</div>
<form action="/noticia/buscar" method="get" onsubmit="return showLoad()">
<div class="panel-body">
<label class="label-control">Buscar</label>
<input type="text" name="noticiero_turno" class="form-control" placeholder="Please input stock name/description" required="required">
<br>
</div>
<div class="panel-footer">
<button type="submit" class="btn btn-success">Buscar</button>
</div>
</form>
</div>
@if (isset($noticias))
<div class="panel panel-success">
<div class="panel-heading">Resultado de busqueda</div>
<div class="panel-body">
<div class='table-responsive'>
<table class='table table-bordered table-hover'>
<thead>
<tr>
<th>ID</th>
<th>Turno</th>
<th>Fecha</th>
<th>nombre_nota</th>
</tr>
</thead>
<tbody>
@foreach($noticia as $buscar)
<tr>
<td>{{$buscar['noticiero_programa']}}</td>
<td>{{$buscar['noticiero_turno']}}</td>
<td>{{$buscar['noticiero_fecha']}}</td>
<tr/>
@endforeach
<tr>
</tr>
</tbody>
</table>
<center></center>
</div>
</div>
<div class="panel-footer">
<a href="{{url('noticia/buscar')}}" class="btn btn-warning">Reiniciar busqueda</a>
</div>
</div>
@endif
@if (isset($noticia))
<div class="panel panel-success">
<div class="panel-heading">Resultado de busqueda</div>
<div class="panel-body">
<div class='table-responsive'>
<table class='table table-bordered table-hover'>
<thead>
<tr>
<th>ID</th>
<th>Turno</th>
<th>Fecha</th>
<th>nombre_nota</th>
</tr>
</thead>
<tbody>
@foreach($noticia as $buscar)
<tr>
<td>{{$buscar['noticiero_programa']}}</td>
<td>{{$buscar['noticiero_turno']}}</td>
<td>{{$buscar['noticiero_fecha']}}</td>
<td>{{$buscar['nombre_nota']}}</td>
<tr/>
@endforeach
@endif
@stop