mirror of
https://gitlab.com/CIEFWorldwideSdnBhd/izyim-api.git
synced 2026-08-20 13:04:18 +00:00
Added listing of Contacts frontend
This commit is contained in:
@@ -11,14 +11,23 @@ class ContactController extends Controller
|
||||
{
|
||||
public function index()
|
||||
{
|
||||
$contacts = Contact::where('user_id', Auth::user()->id)->where('id', $id)->get();
|
||||
$output= array();
|
||||
$contacts = Contact::where('user_id', Auth::user()->id)->get();
|
||||
$companies= Contact::with('companies')->get();
|
||||
//$companies =\DB::table('companies')->select('contacts.com_id', 'companies.id', 'companies.company_name')->join('contacts', 'contacts.com_id', '=', 'companies.id')->get();
|
||||
//$companies = "SELECT contacts.com_id, companies.id, companies.company_name FROM `companies` INNER JOIN contacts ON contacts.com_id = companies.id";
|
||||
|
||||
// $companies = \DB::table('companies')
|
||||
// ->select('id', 'company_name')
|
||||
// ->where('com_id', Auth::user()->id)
|
||||
// ->get();
|
||||
|
||||
if (!$contacts)
|
||||
{
|
||||
return response()->json(['message'=>'Access Denied!'], 404);
|
||||
}
|
||||
|
||||
return response()->json($contacts, 200);
|
||||
return response()->json($companies, 200);
|
||||
}
|
||||
|
||||
public function sendRequest(Request $request)
|
||||
|
||||
Reference in New Issue
Block a user