big commit

This commit is contained in:
omair saleh
2021-04-06 16:42:17 +08:00
parent 88124a56d2
commit 3d7f8da114
2 changed files with 3 additions and 10 deletions
+3 -2
View File
@@ -18,11 +18,12 @@ class CompanyResource extends JsonResource
*/
public function toArray($request)
{
$companyModule = $this->modules->first();
return [
'id' => $this->id,
'account_no' => $this->reference_no,
'marking' => CompanyConnections::where('module_one', $this->modules->first()->id)->first()->marking,
'email' => $this->employees->first()->email,
'marking' => CompanyConnections::where('module_one', $companyModule->id)->first()->marking,
'email' => $companyModule->employees->first()->email,
'name' => $this->name,
'type' => $this->type,
'status' => (int) $this->status,