app/Http/Controllers/UsersController.php
/**
     * Display a listing of the resource.
     *
     * @return \Illuminate\Http\Response
     */
Display a listing of the resource.
@return \Illuminate\Http\Response
Display a listing of the resource . @return \ Illuminate \ Http \ Response
public function indexFrontend() {
        if (!Auth::check()) {
            return redirect()->route('login');
        } else {
        $user = User::find(Auth::user()->id);
        $blogs = Blog::where('id_user', '=', Auth::user()->id)->count();
        $receitas = receitas::where('id_user', '=', Auth::user()->id)->count();
        return view('paginas.frontend.perfil', compact([
            'user',
            'blogs',
            'receitas'
        ]));
        }
    }
public function indexFrontend ( ) { if ( ! Auth :: check ( ) ) { return redirect ( ) -> route ( 'login' ) ; } else { $ user = User :: find ( Auth :: user ( ) -> id ) ; $ blogs = Blog :: where ( 'id_user' , '=' , Auth :: user ( ) -> id ) -> count ( ) ; $ receitas = receitas :: where ( 'id_user' , '=' , Auth :: user ( ) -> id ) -> count ( ) ; return view ( 'paginas.frontend.perfil' , compact ( [ 'user' , 'blogs' , 'receitas' ] ) ) ; } }
Display a listing of the resource.
Display a listing of the resource .