mirror of
https://gitlab.com/CIEFWorldwideSdnBhd/izyim-api.git
synced 2026-08-21 13:34:16 +00:00
Merge branch 'asif/warehouses' of gitlab.com:CIEFWorldwideSdnBhd/izyim-api into asif/contact
# Conflicts: # app/Http/Controllers/ContactController.php # routes/api.php
This commit is contained in:
@@ -17,13 +17,12 @@ class CompanyController extends Controller
|
||||
}
|
||||
$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,
|
||||
array_push($output, ['com_id'=> $matchedTerm->id, 'company_name' => $matchedTerm->company_name, 'tel_no' => $matchedTerm->tel_no,
|
||||
'contact_person'=>$matchedTerm->contact_person ]);
|
||||
}
|
||||
|
||||
@@ -53,14 +52,17 @@ class CompanyController extends Controller
|
||||
'state' => 'required',
|
||||
'country' => 'required',
|
||||
'contact_person' => 'required'
|
||||
];
|
||||
];
|
||||
|
||||
$validator = Validator::make($request->all(), $rules);
|
||||
if($validator->fails()) {
|
||||
return response()->json(['success'=> false, 'error'=> 'All the fields are required'], 400);
|
||||
//return response()->json(['success'=> false, 'error'=> $validator->messages()], 400);
|
||||
$validator = Validator::make($request->all(), $rules);
|
||||
if($validator->fails()) {
|
||||
return response()->json(['success'=> false, 'error'=> 'All the fields are required'], 400);
|
||||
//return response()->json(['success'=> false, 'error'=> $validator->messages()], 400);
|
||||
}
|
||||
}
|
||||
|
||||
public function create()
|
||||
{
|
||||
$company->company_name=$request->input('company_name');
|
||||
$company->registration_no=$request->input('registration_no');
|
||||
$company->tax_no=$request->input('tax_no');
|
||||
|
||||
Reference in New Issue
Block a user