{{ Form::open(array('action' =>('ProductController@postUseSearch'))) }}
{{ Form::text('keyword', null, array('placeholder' => 'search by keyword')) }}
{{ Form::submit('search') }}
{{ Form::close() }}
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
Route::get('/search/', array(
'as' => 'name-search',
'uses' => 'ProductController@showSearchPage'
));
Route::post('/search/', array(
'as' => 'name-search-post',
'uses' => 'ProductController@postUseSearch'
));
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
public function postUseSearch(){
$searchString = Input::get('keyword');
$insert = new Searchword();
$insert->keyword = $searchString; // not saving into the database?
more code...
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
<?php
use Illuminate\Auth\UserTrait;
use Illuminate\Auth\UserInterface;
use Illuminate\Auth\Reminders\RemindableTrait;
use Illuminate\Auth\Reminders\RemindableInterface;
class Searchword extends Eloquent implements UserInterface, RemindableInterface {
protected $fillable = array (
'keyword'
);
use UserTrait, RemindableTrait;
/**
* The database table used by the model.
*
* @var string
*/
protected $table = 'searchword';
/**
* The attributes excluded from the model's JSON form.
*
* @var array
*/
protected $hidden = array();
}
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
Database Schema
id (int)
keyword (varchar 255)
updated_at (datetime)
created_at (datetime)