app/Http/Controllers/ProductController.php
/**
     * Show the form for creating a new resource.
     *
     * @return \Illuminate\Http\Response
     */
Show the form for creating a new resource.
@return \Illuminate\Http\Response
Show the form for creating a new resource . @return \ Illuminate \ Http \ Response
public function search(Request $request)
    {
        $keywork = $request->input('keyWork');
        $slug = Str::slug($keywork);
        $category = category::where([
            ['name','like','%'.$keywork.'%'],
            ['is_active','=',1]
        ])->orWhere([
            ['slug','like','%'.$slug.'%'],
        ])->paginate(5);
        return view('admin.category.search',['category'=>$category,'keyWork' => $keywork ? $keywork : '']);
    }
public function search ( Request $ request ) { $ keywork = $ request -> input ( 'keyWork' ) ; $ slug = Str :: slug ( $ keywork ) ; $ category = category :: where ( [ [ 'name' , 'like' , '%' . $ keywork . '%' ] , [ 'is_active' , '=' , 1 ] ] ) -> orWhere ( [ [ 'slug' , 'like' , '%' . $ slug . '%' ] , ] ) -> paginate ( 5 ) ; return view ( 'admin.category.search' , [ 'category' => $ category , 'keyWork' => $ keywork ? $ keywork : '' ] ) ; }
Show the form for creating a new resource.
Show the form for creating a new resource .
//  Model //