app/Http/Controllers/HomeController.php
/**
     * Show the application dashboard.
     *
     * @return \Illuminate\Contracts\Support\Renderable
     */
Show the application dashboard.
@return \Illuminate\Contracts\Support\Renderable
Show the application dashboard . @return \ Illuminate \ Contracts \ Support \ Renderable
public function index(Request $request)
    {
        $userName = Auth::user()->name;
        $groups = \App\Group::all();
        if($request->input('filter')) {
            $groups = \App\Group::where('name', '=', $request->input('filter'))->get(); 
        }
        return view('home', [
            "userName" => $userName,
            'groups' => $groups,
        ]);
    }
public function index ( Request $ request ) { $ userName = Auth :: user ( ) -> name ; $ groups = \ App \ Group :: all ( ) ; if ( $ request -> input ( 'filter' ) ) { $ groups = \ App \ Group :: where ( 'name' , '=' , $ request -> input ( 'filter' ) ) -> get ( ) ; } return view ( 'home' , [ " userName " => $ userName , 'groups' => $ groups , ] ) ; }
Show the application dashboard.
Show the application dashboard .
//when user is in home page they will be able to access all groups