<?php

namespace App\Http\Controllers;

use Illuminate\Http\Request;
use DB;
use Auth;

class FcController extends Controller
{
  public function index(){
     return Auth::user();
 }
  public function fcDetails($orgid,$user,$username)
    {
      $users=array(); 
      if($user=='organization'){
          $users = DB::connection('mysql_fc')->table('organizations')->where('api_account',$orgid)->where('username',$username)->get();
          if($users){
              return redirect()->route('organization-dashboard');
          }
      }
      elseif($user=='organization_user'){
          $users = DB::connection('mysql_fc')->table('organization_users')->where('api_account',$orgid)->where('username',$username)->get();
      }
       
       
       return $users;
    }
}
