diff --git a/app/Http/Controllers/ContentController.php b/app/Http/Controllers/ContentController.php index ffc4ae7..4871514 100644 --- a/app/Http/Controllers/ContentController.php +++ b/app/Http/Controllers/ContentController.php @@ -19,9 +19,26 @@ class ContentController extends Controller public function show($path){ - $content = Content::where('path', $path)->first(); + $content = Content::where('path', $path)->firstOrFail(); return view('softbox')->with('content', $content); } + + public function home(){ + + $categories = Category::where("category_id", null)->get(); + //dd($category); + + return view('home')->with('categories', $categories); + + } + + public function search(){ + $query = request()->input('query'); + + $contents = Content::where('name','like',"%$query%")->orWhere('description','like',"%$query%")->get(); + dd($contents); + return view('search')->with('contents', $contents); + } }