Couple of questions about searching

Published 4 months ago by BladeSlayer1000

Hi All,

I'm currently working on a small order system which needs a search function. I did look at Laravel Scout and I have some questions about it;

  1. Can I use Laravel scout even when the PC isn't connected to the internet?
  2. If I can use Laravel scout offline, which driver do you suggest?
  3. Are there any other possibility's for searching besides Laravel Scout?
jlrdw
jlrdw
4 months ago (199,820 XP)
BladeSlayer1000

I have used that, but then I run into a problem with my pagination. Where it links to the page I'm calling, and thus showing a page without a layout and only results. I can post the code I was using if you want.

jlrdw
jlrdw
4 months ago (199,820 XP)

This works, not laravel but same , you have to append querystring

    public function indexAdmin()
    {
        if ($this->chklog() == 'notlogged') {
            return Redirect::to('admin');
        }
        $page = Input::get('page', '1');
        $rowsPerPage = 10;
        $offset = ($page - 1) * $rowsPerPage;
        $dogsearch = (isset($_REQUEST['psch']) <> '' ? $_REQUEST['psch'] : "");
        $dogsch = $dogsearch . "%";
        $aval = (isset($_REQUEST['aval']) <> '' ? $_REQUEST['aval'] : "");
        Session::set('dogsearch', $dogsearch);
        Session::set('dogaval', $aval);
        if ($aval == "n") {
            $dogrows = Dog::where('dogname', 'like', $dogsch)->where('adopted', '=', 1)->count();
        }
        if ($aval == "y") {
            $dogrows = Dog::where('dogname', 'like', $dogsch)->where('adopted', '=', 0)->count();
        }
        if ($aval == "") {
            $dogrows = Dog::where('dogname', 'like', $dogsch)->count();
        }
        Session::set('dogrows', $dogrows);
        $query = Dog::where('dogname', 'like', $dogsch);
        if ($aval == "n") {
            $query->where('adopted', '=', 1);
        } else if ($aval == "y") {
            $query->where('adopted', '=', 0);
        }
        $dogs = $query->orderBy('lastedit', 'DESC')->paginate(5);
        $pagelinks = array('psch' => $dogsearch, 'aval' => $aval);
        $this->template = 'Bootstrap';
        $this->layout = 'Indexadmintp';
        return $this->getView()
                        ->shares('title', 'Dogadmin')
                        ->with('dogs', $dogs)
                        ->with('pagelinks', $pagelinks);
    }
BladeSlayer1000

Quickly after your post I find a solution to my problem. But thanks for your code.

Please sign in or create an account to participate in this conversation.