laravel create search

Solutions on MaxInterview for laravel create search by the best coders in the world

showing results for - "laravel create search"
Juan Esteban
31 Apr 2020
1public function index(){
2      // // we need to show all data from "blog" table
3      // $blogs = Blog::all();
4      // // show data to our view
5      // return view('blog.index',['blogs' => $blogs]);
6
7      $search = Request::get('search');
8      $blogs = Blog::where('title','like','%'.$search.'%')->orderBy('id')->paginate(6);
9      return view('blog.index',['blogs' => $blogs]);
10    }
11
Matilda
13 Aug 2017
1@extends('app')
2  @section('content')
3  <div class="form-group row add">
4    <div class="col-md-6">
5      <h1>Simple Laravel Ajax Crud</h1>
6    </div>
7    <div class="col-md-6">
8      {!! Form::open(['method'=>'GET','url'=>'blog','class'=>'navbar-form navbar-left','role'=>'search']) !!}
9      <div class="input-group custom-search-form">
10        <input type="text" name="search" class="form-control" placeholder="Search ....">
11        <span class="input-group-btn">
12          <button type="submit" class="btn btn-default-sm">
13            <i class="fa fa-search"></i>
14          </button>
15        </span>
16      </div>
17      {!! Form::close() !!}
18    </div>
19  </div>
20
21  <div class="form-group row add">
22    <div class="col-md-5">
23      <input type="text" class="form-control" id="title" name="title"
24      placeholder="Your title Here" required>
25      <p class="error text-center alert alert-danger hidden"></p>
26    </div>
27    <div class="col-md-5">
28      <input type="text" class="form-control" id="description" name="description"
29      placeholder="Your description Here" required>
30      <p class="error text-center alert alert-danger hidden"></p>
31    </div>
32    <div class="col-md-2">
33      <button class="btn btn-warning" type="submit" id="add">
34        <span class="glyphicon glyphicon-plus"></span> Add New Data
35      </button>
36    </div>
37  </div>
38
39  <div class="row">
40    <div class="table-responsive">
41      <table class="table table-borderless" id="table">
42        <tr>
43          <th>No.</th>
44          <th>Title</th>
45          <th>Description</th>
46          <th>Actions</th>
47        </tr>
48        {{ csrf_field() }}
49
50        <?php $no=1; ?>
51        @foreach($blogs as $blog)
52          <tr class="item{{$blog->id}}">
53            <td>{{$no++}}</td>
54            <td>{{$blog->title}}</td>
55            <td>{{$blog->description}}</td>
56            <td>
57            <button class="edit-modal btn btn-primary" data-id="{{$blog->id}}" data-title="{{$blog->title}}" data-description="{{$blog->description}}">
58              <span class="glyphicon glyphicon-edit"></span> Edit
59            </button>
60            <button class="delete-modal btn btn-danger" data-id="{{$blog->id}}" data-title="{{$blog->title}}" data-description="{{$blog->description}}">
61              <span class="glyphicon glyphicon-trash"></span> Delete
62            </button>
63          </td>
64          </tr>
65        @endforeach
66      </table>
67      {!! $blogs->links() !!}
68    </div>
69  </div>
70  <div id="myModal" class="modal fade" role="dialog">
71    <div class="modal-dialog">
72      <div class="modal-content">
73        <div class="modal-header">
74          <button type="button" class="close" data-dismiss="modal">×</button>
75            <h4 class="modal-title"></h4>
76        </div>
77        <div class="modal-body">
78          <form class="form-horizontal" role="form">
79            <div class="form-group">
80              <label class="control-label col-sm-2" for="id">ID :</label>
81              <div class="col-sm-10">
82                <input type="text" class="form-control" id="fid" disabled>
83              </div>
84              </div>
85              <div class="form-group">
86              <label class="control-label col-sm-2" for="title">Title:</label>
87              <div class="col-sm-10">
88                <input type="name" class="form-control" id="t">
89              </div>
90            </div>
91            <div class="form-group">
92            <label class="control-label col-sm-2" for="description">Description:</label>
93            <div class="col-sm-10">
94              <input type="name" class="form-control" id="d">
95            </div>
96          </div>
97          </form>
98            <div class="deleteContent">
99            Are you Sure you want to delete <span class="title"></span> ?
100            <span class="hidden id"></span>
101          </div>
102          <div class="modal-footer">
103            <button type="button" class="btn actionBtn" data-dismiss="modal">
104              <span id="footer_action_button" class='glyphicon'> </span>
105            </button>
106            <button type="button" class="btn btn-warning" data-dismiss="modal">
107              <span class='glyphicon glyphicon-remove'></span> Close
108            </button>
109          </div>
110        </div>
111      </div>
112    </div>
113  </div>
114  @stop
115
queries leading to this page
laravel search boxsearch php laravelsearch function laravel form search laralaravel search function examplesearch in laravelsearch form laravellaravel and or searchlaravel input searchlaravel 8 search filtersearch code in laravellaravel 8 search examplelaravel generale search barsearch functionality in laravel examplehow search code in laravellaravel model search methodbest search for laravellaravel search methodlaravel search 2aadd search function to laravel 8how to implement search laravalhow to search created at laravellaravel function searchlaravel best searchsearch data in laravellaravel do search barsearch filter demo in laravelsimple search in laravellaravle search how to search and filletere in laraveliimplementing search in laravelelestch search laravellike search in laravellaravel 5 search functionalitycreate a simple search in laravelsearch on laravellaravel searchtablelaravel 25search 25laravel 8 searchsearch 28 29 laravelhow to add simple search laravellaravel proper searchlaravel where and searchsearch api laravelhow to make a search bar in html and laravellaravel searchlaravel database searchimplement search in laravelsearch using with in laravel laravel db searchsearch laravel 5 4search form in laravelcreate search box in laravelbuild a search form with laravelcreating search in laravelmethod search laravelwhere laravel searchsearch laravellaravel search queryautomatic search in laravellaravel simple searchlaravel searchablelaravel search form exampleall search inb laravel8laravel search functionhow to make search bar in laravelcreate search user in laravelsearch laravel 8search en laravellaravel search data laravel where searchlaravel 8 search functionlaravel website search laravel search examplesearch example laravellaravel 8 full searchfrom and to data search in laravelhow to create a search query in laravelsearch for laravelsearch function in laravel 7search laravellaravel search functionalitylaravel search using getcreate search in laravellaravel search barsearch in laravel querysearch function in laravel tutorialhow to implement search in laravel 5 8search in laravel code examplefunction search in laravellaravel field searchablehow to make a search box in laravel for database 2a in search laravel html search laravelsearch function in laravel 8search bar laraveladd search to laravellarvel searchsearch laravel getlaravel searchingwhere search in laravelhow to make search box in laravellaravel 3a 3asearchsearch with created at laravelsearch laravel 7laravel full text searchlaravel search eloquontuse when 28 29 and with 28 29 in search laravelsearch in laravel7general search bar laravelhow to implement search functionality in laravel 8searching in laravelsearching laravelhow to make a search bar in laravellaravel search tutoriallaravel text searchlaravel make search bettersearch functionality in laravel 5 7laravel where like search controllerbest laravel search add search inside laravel projecthow to implement search in laraveluse when and with in search laravellaravel search function tutoriallaravel simple search systemrecent search in php laravelsearch 2b laravellaravel search bar laravel 8creating search page in laravelsearch laravel using ajachow to implement search functionality in laraveldata search in laravellaravel search laravel 8laravel table get search barsearch operation laravelsearch bar in laravel 8search with laravel 8 7e 2a in search laravellaravel search fromsearch in laravel 5elestch search laravel 27laravel create searchersearch data laravellaravel searchabellaravel implement searchlaravel scout algolia search exampleform search laravelsearch in laravel examplelaravel 8 search barsearch functionality in laravelpopular search laravelsearch bar php laraveladd search functionality in laraveldoing search for laravellaravel form searchcreate a document search system in laravellaravel search form tutoriallaravel search or andhow to apply search laravelsearch with get laravelsearch bar laravel 8search bar in laravelhow to create search in laravellaravel search enginejust laravel search functionalityhow to create search function in laravelcreating search laravellaravel create searchlaravel search formlaravel search tablelaravel 8 create search functionsearch laravel like instagramcreating a search engine in php laravellaravel 6 search functionlaravel search resultssearch instead in laravelsimple search form in laravelwhere search laravelsearch php laravel wheresearch in laravel8search method laravellaravel search systemsearch function laravelstore search in laravelsearch functionality in laravel 8input search laravellaravel query searchlqravel searchlaravel make searchcreate a search page laravellaravel string searchgoutte search laravellaravel 8 searchbarsearch functionality in laravel8make search in laravelsearch with laravelsearch functionality in laravel 7how to create search in laravel 8search field laravellaravel search query example search barsearch in laravel 8laravel searchable tutorialhow to search in laravelsearch in laravel 7laravel 8 new searchmake a search laravellaravel create search