mostafa_kz/ajax_search_for_laravel is a Laravel package.
It currently has 1 GitHub stars and 6 downloads on Packagist.
Install it with composer require mostafa_kz/ajax_search_for_laravel.
Discover more Laravel packages by mostafa_kz
or browse all Laravel packages to compare alternatives.
Last updated
laravel-ajax-search is a package for Laravel 5+ that helps you to create simple ajax search.it must be amazin :)
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
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,
],
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,
],
In your terminal type
php artisan vendor:publish
or
php artisan vendor:publish --provider="Search\SearchProvider"
run this command for init table in your project
php artisan migrate
put this routes in web.php
Route::get('/','SearchController@index');
Route::get('/search','SearchController@search')->name('search.result');
run this command for create controller
php artisan make:controller SearchController
then put this code on SearchController
<?php
namespace App\Http\Controllers;
use Search;
use App\File;
use Illuminate\Http\Request;
class SearchController extends Controller
{
public function index()
{
return Search::setViewSearch();
}
public function search()
{
return Search::setResultSearch();
}
}
php artisan make:auth