I hit an api on postman when firstly hit an api it update the company checkin status but not show on postman it show empty array of company Checkin. after when i secondly hit an api it shows the checkin status array. Please help. Thanks in Advance
public function checkinCompany(Company $company)
{
if (! $this->isCheckedinCompany($company))
{
return $this->checkinCompanies()->attach($company);
}
}
public function isCheckedinCompany(Company $company)
{
return !! CompanyCheckin::where('company_id', $company->id)- >where('user_id', $this->id)->count();
}
I want this to shoe company checkin array on first hit
via Chebli Mohamed
Aucun commentaire:
Enregistrer un commentaire