PHPackages                             mostafa\_kz/ajax\_search\_for\_laravel - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Search &amp; Filtering](/categories/search)
4. /
5. mostafa\_kz/ajax\_search\_for\_laravel

ActiveLibrary[Search &amp; Filtering](/categories/search)

mostafa\_kz/ajax\_search\_for\_laravel
======================================

16PHP

Since Sep 16Pushed 7y ago1 watchersCompare

[ Source](https://github.com/mkz2035/laravel-ajax-search)[ Packagist](https://packagist.org/packages/mostafa_kz/ajax_search_for_laravel)[ RSS](/packages/mostafa-kz-ajax-search-for-laravel/feed)WikiDiscussions master Synced yesterday

READMEChangelogDependenciesVersions (1)Used By (0)

laravel-ajax-search
===================

[](#laravel-ajax-search)

written by mostafa karimzadeh
-----------------------------

[](#written-by-mostafa-karimzadeh)

#### Accountant in khu university

[](#accountant-in-khu-university)

laravel-ajax-search is a package for Laravel 5+ that helps you to create simple ajax search.it must be amazin :)

Installation
------------

[](#installation)

### 1 - Dependency

[](#1---dependency)

The first step is using composer to install the package and automatically update your composer.json file, you can do this by running

```
composer require mostafa_kz/ajax_search_for_laravel

```

### 2 - Provider

[](#2---provider)

You need to update your application configuration in order to register the package so it can be loaded by Laravel, just update your **config/app.php** file adding the following code at the end of your '**providers**

```
    'providers' => [
         Search\SearchProvider::class,
    ],

```

### 3 - Facade

[](#3---facade)

In order to use the **Search** facade, you need to register it on the **config/app.php** file, you can do that the following way:

```
   'aliases' => [
    'Search' => Search\SearchFacade::class,
    ],

```

### 4 - Configuration

[](#4---configuration)

In your terminal type

```
  php artisan vendor:publish

```

or

```
 php artisan vendor:publish --provider="Search\SearchProvider"

```

Usage
-----

[](#usage)

### 1 - Database(Migration)

[](#1---databasemigration)

run this command for init table in your project

```
 php artisan migrate

```

### 2 - Init Routes

[](#2---init-routes)

put this routes in **web.php**

```
Route::get('/','SearchController@index');
Route::get('/search','SearchController@search')->name('search.result');

```

### 3 - Init Controllers

[](#3---init-controllers)

run this command for create controller

```
php artisan make:controller SearchController

```

then put this code on **SearchController**

```
