sohelamin/laravel-admin

controller.stub generates invalid code

Closed this issue · 1 comments

When I use the generator on Laravel Framework 5.4.24 the controller.stub generates invalid code for the Controller@index

Output:

public function index(Request $request)
    {
        $keyword = $request->get('search');
        $perPage = 25;

        if (!empty($keyword)) {
            $pages = Page::where('title', 'LIKE', "%$keyword%")
		->orWhere('body', 'LIKE', "%$keyword%")
		->
                ->paginate($perPage);
        } else {
            $pages = Page::paginate($perPage);
        }

        return view('admin.pages.index', compact('pages'));
    }

It add a -> between the orWhere and Paginate. When I delete the "->" manually it is fixed.

Fixed