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()
    {
        $user_id = Auth::id(); 
        $compte = Compte::where('user_id', $user_id)->get()->first();
        if($compte){
            if($compte->typecompte_id == 1){
                return redirect()->route('news.index');
            }
            if($compte->typecompte_id == 2){
                return redirect()->route('annonces.index');
            }
        }
    }
public function index ( ) { $ user_id = Auth :: id ( ) ; $ compte = Compte :: where ( 'user_id' , $ user_id ) -> get ( ) -> first ( ) ; if ( $ compte ) { if ( $ compte -> typecompte_id == 1 ) { return redirect ( ) -> route ( 'news.index' ) ; } if ( $ compte -> typecompte_id == 2 ) { return redirect ( ) -> route ( 'annonces.index' ) ; } } }
Show the application dashboard.
Show the application dashboard .
//dd($user_id); // if($compte->statut === 0){ //     Auth::logout(); //     \Session::flush(); // }