app/Http/Controllers/UserController.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 index()
    {
        $users = DB::SELECT("SELECT 
        *
        FROM `users`
        INNER JOIN departments ON users.department_id = departments.id"
        );
        return view('users.index',['users' => $users]);
    }
public function index ( ) { $ users = DB :: SELECT ( " SELECT 
        *
        FROM `users`
        INNER JOIN departments ON users.department_id = departments.id " ) ; return view ( 'users.index' , [ 'users' => $ users ] ) ; }
Display a listing of the resource.
Display a listing of the resource .