App Store search issue solved
This commit is contained in:
parent
244b5aabbe
commit
1294ab3f8b
@ -5,6 +5,7 @@ namespace App\Http\Controllers\Modules;
|
||||
use App\Http\Controllers\Controller;
|
||||
use App\Traits\Modules;
|
||||
use Illuminate\Routing\Route;
|
||||
use Illuminate\Http\Request;
|
||||
|
||||
class Tiles extends Controller
|
||||
{
|
||||
@ -73,4 +74,27 @@ class Tiles extends Controller
|
||||
|
||||
return view('modules.tiles.index', compact('title', 'modules'));
|
||||
}
|
||||
|
||||
/**
|
||||
* Show the form for viewing the specified resource.
|
||||
*
|
||||
* @return Response
|
||||
*/
|
||||
public function searchModules(Request $request)
|
||||
{
|
||||
$this->checkApiToken();
|
||||
|
||||
$keyword = $request['keyword'];
|
||||
|
||||
$data = [
|
||||
'query' => [
|
||||
'keyword' => $keyword,
|
||||
]
|
||||
];
|
||||
|
||||
$title = trans('modules.search');
|
||||
$modules = $this->getSearchModules($data);
|
||||
|
||||
return view('modules.tiles.index', compact('title', 'modules', 'keyword'));
|
||||
}
|
||||
}
|
||||
|
@ -108,6 +108,17 @@ trait Modules
|
||||
return [];
|
||||
}
|
||||
|
||||
public function getSearchModules($data = [])
|
||||
{
|
||||
$response = $this->getRemote('apps/search', 'GET', $data);
|
||||
|
||||
if ($response->getStatusCode() == 200) {
|
||||
return json_decode($response->getBody())->data;
|
||||
}
|
||||
|
||||
return [];
|
||||
}
|
||||
|
||||
public function getCoreVersion()
|
||||
{
|
||||
$data['query'] = Info::all();
|
||||
|
@ -9,6 +9,7 @@ return [
|
||||
'new' => 'New',
|
||||
'top_free' => 'Top Free',
|
||||
'free' => 'FREE',
|
||||
'search' => 'Search',
|
||||
'install' => 'Install',
|
||||
'buy_now' => 'Buy Now',
|
||||
'token_link' => '<a href="https://akaunting.com/tokens" target="_blank">Click here</a> to get your API token.',
|
||||
|
@ -4,15 +4,15 @@
|
||||
|
||||
<div class="pull-left">
|
||||
{!! Form::select('category', $categories, request('category'), ['class' => 'form-control input-sm', 'style' => 'display:inline;width:inherit;']) !!}
|
||||
<a href="{{ url('apps/paid') }}" class="btn btn-sm btn-default btn-flat margin" style="margin-left: 20px;">Top Paid</a>
|
||||
<a href="{{ url('apps/new') }}" class="btn btn-sm btn-default btn-flat margin">New</a>
|
||||
<a href="{{ url('apps/free') }}" class="btn btn-sm btn-default btn-flat margin">Top Free</a>
|
||||
<a href="{{ url('apps/paid') }}" class="btn btn-sm btn-default btn-flat margin" style="margin-left: 20px;">{{ trans('modules.top_paid') }}</a>
|
||||
<a href="{{ url('apps/new') }}" class="btn btn-sm btn-default btn-flat margin">{{ trans('modules.new') }}</a>
|
||||
<a href="{{ url('apps/free') }}" class="btn btn-sm btn-default btn-flat margin">{{ trans('modules.top_free') }}</a>
|
||||
</div>
|
||||
|
||||
<div class="pull-right">
|
||||
<div class="has-feedback">
|
||||
{!! Form::open(['url' => 'apps/search', 'role' => 'form']) !!}
|
||||
<input type="text" class="form-control input-sm" style="margin-top: 10px;" placeholder="Search Apps">
|
||||
{!! Form::open(['url' => 'apps/search', 'role' => 'form', 'method' => 'GET']) !!}
|
||||
<input name="keyword" value="{{ isset($keyword) ? $keyword : '' }}" type="text" class="form-control input-sm" style="margin-top: 10px;" placeholder="Search Apps">
|
||||
<span class="glyphicon glyphicon-search form-control-feedback"></span>
|
||||
{!! Form::close() !!}
|
||||
</div>
|
||||
|
@ -120,6 +120,7 @@ Route::group(['middleware' => 'language'], function () {
|
||||
Route::get('paid', 'Modules\Tiles@paidModules');
|
||||
Route::get('new', 'Modules\Tiles@newModules');
|
||||
Route::get('free', 'Modules\Tiles@freeModules');
|
||||
Route::get('search', 'Modules\Tiles@searchModules');
|
||||
Route::post('steps', 'Modules\Item@steps');
|
||||
Route::post('download', 'Modules\Item@download');
|
||||
Route::post('unzip', 'Modules\Item@unzip');
|
||||
|
Loading…
x
Reference in New Issue
Block a user