функция поиска без обязательного входа - PullRequest
0 голосов
/ 11 октября 2019

это функция поиска, которая должна войти в систему, чтобы увидеть поисковый блейд. Я хочу показать поисковый блейд без обязательного входа в систему учащегося и разрешить кому-либо использовать эту функцию

, это моя функция поиска в контроллере

public function search()
{
    $q = Input::get ( 'q' );
    if($q != ""){
        $student = Student::where ( 'uniid', 'LIKE', '%' . $q . '%' )->get();
        if (count ( $student ) > 0)
            return view ( 'search' )->withDetails ( $student )->withQuery ( $q );
        else
            return view ( 'search' )->withMessage ( 'not fount' );
    }
    return view ( 'search' )->withMessage ( 'write the number want to search' );
}

и это мой поисковый блейд

<!DOCTYPE html>
 <html>
  <head>
  <title>Search</title>
  <meta charset="utf-8">
  <meta name="viewport" content="width=device-width, initial-scale=1">
  <link rel="stylesheet" href="http://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css">
  </head>
  <body>
  <div class="container">
  <form action="/search" method="POST" role="search">
  {{ csrf_field() }}
  <div class="input-group">
    <input type="text" class="form-control" name="q"
        placeholder="search.."> <span class="input-group-btn">
        <button type="submit" class="btn btn-default">
            <span class="glyphicon glyphicon-search"></span>
        </button>
    </span>
</div>
</form>
 <div class="container">
@if(isset($details))
<table class="table table-striped">
    <thead>
        <tr>
            <th> unique id</th>
            <th>  order statuse</th>
        </tr>
    </thead>
    <tbody>
        @foreach($details as $request)
        <tr>
            <td>{{$request->uniid}}</td>
            <td>{{$request->status->name}}</td>
        </tr>
        @endforeach
    </tbody>
</table>
@elseif(isset($message))
<p>{{ $message }}</p>
@endif
</div>
</body>
</html>
Добро пожаловать на сайт PullRequest, где вы можете задавать вопросы и получать ответы от других членов сообщества.
...