mirror of
https://gitlab.com/CIEFWorldwideSdnBhd/izyim-api.git
synced 2026-08-19 12:34:06 +00:00
Merge branch 'asif/contact' of gitlab.com:CIEFWorldwideSdnBhd/izyim-api into asif/warehouses
# Conflicts: # app/Http/Controllers/CompanyController.php # package-lock.json # routes/api.php
This commit is contained in:
@@ -10,6 +10,28 @@ use Auth;
|
||||
|
||||
class CompanyController extends Controller
|
||||
{
|
||||
public function search(Request $request)
|
||||
{
|
||||
if($request->search == ''){
|
||||
return '';
|
||||
}
|
||||
$output= array();
|
||||
$matchedTerms = Company::where('company_name', 'LIKE','%'. $request->search . '%')->get();
|
||||
//return response()->json($matchedTerm);
|
||||
|
||||
if($matchedTerms)
|
||||
{
|
||||
foreach ($matchedTerms as $key => $matchedTerm)
|
||||
{
|
||||
array_push($output, ['company_name' => $matchedTerm->company_name, 'tel_no' => $matchedTerm->tel_no,
|
||||
'contact_person'=>$matchedTerm->contact_person ]);
|
||||
}
|
||||
|
||||
return response($output);
|
||||
}
|
||||
else{return "error";}
|
||||
}
|
||||
|
||||
public function update(Request $request)
|
||||
{
|
||||
$company = Company::where("user_id", Auth::user()->id)->first();
|
||||
|
||||
Reference in New Issue
Block a user