I have a controller called CharactersController.php in my controllers directory. Here are the two functions:
public function search()
{
return View::make('search.search');
}
public function post_search()
{
$name = Input::get('character');
$searchResult = Player::where('name', 'LIKE', '%'.$name.'%')->paginate(5);
return View::make('search.post_search')
->with('name', $name)
->with('searchResult', $searchResult);
}
In the first function (function search()
) I return a view. Here's the code of the view(just the form):
<form id="custom-search-form" class="form-search form-horizontal pull-right" action="{{ URL::action('CharactersController@post_search') }}" method="get">
<div class="input-append spancustom">
<input type="text" class="search-query" name="character" placeholder="Character/guild name">
<button type="submit" class="btn"><i class="icon-search"></i></button>
</div>
</form>
When I try to run the form (to search) I get an Unknown action [CharactersController@post_search].
error. I had this error before, I tried switching controllers, tried doing everything. But it didn't work. So I gave up.
Anyone who can solve it?