public function search(Request $request)
    {
        $images = $this->imageRepository->search($request->term);

        if($request->ajax()) return response()->json([
            'images' => view('laramanager::browser.images', compact('images'))->render()
        ]);

        return view('laramanager::images.index', compact('images'));
    }
public function search(Request $request)
    {
        $images = $this->imageRepository->search($request->term);

        if($request->ajax()) return response()->json([
            'images' => view('laramanager::browser.images', compact('images'))->render()
        ]);

        return view('laramanager::images.index', compact('images'));
    }
public function search ( Request $ request ) { $ images = $ this -> imageRepository -> search ( $ request -> term ) ; if ( $ request -> ajax ( ) ) return response ( ) -> json ( [ 'images' => view ( 'laramanager::browser.images' , compact ( 'images' ) ) -> render ( ) ] ) ; return view ( 'laramanager::images.index' , compact ( 'images' ) ) ; }
Returns images from search results

@param Request $request
@return \Illuminate\Contracts\View\Factory|\Illuminate\Http\JsonResponse|\Illuminate\View\View
@throws \Exception
@throws \Throwable
Returns images from search results