App\Http\Controllers\LangController::index PHP Method

index() public method

다국어 manage 페이지
public index ( Illuminate\Http\Request $request )
$request Illuminate\Http\Request
    public function index(Request $request)
    {
        $namespace = $request->get('namespace');
        $keyword = $request->get('keyword');
        XeFrontend::translation(['lang::admin.editor.saved', 'lang::admin.editor.failed']);
        $conditions = [];
        if ($namespace) {
            $conditions['namespace'] = $namespace;
        }
        if ($keyword) {
            $conditions['value'] = $keyword;
        }
        $pagination = $this->search($conditions)->groupBy('item')->groupBy('namespace')->paginate(10);
        $searchList = $pagination->toArray()['data'];
        $this->withLines($searchList);
        $namespaces = $this->search()->groupBy('namespace')->lists('namespace');
        return XePresenter::make('lang.index', ['selected_namespace' => $namespace, 'selected_keyword' => $keyword, 'namespaces' => $namespaces, 'searchList' => $searchList, 'pagination' => $pagination->appends($request->except([$pagination->getPageName()]))]);
    }