hasCompany($taxType->company_id)) { return true; } return false; } /** * Determine whether the user can create models. * * @param \Crater\Models\User $user * @return mixed */ public function create(User $user) { if (BouncerFacade::can('create-tax-type', TaxType::class)) { return true; } return false; } /** * Determine whether the user can update the model. * * @param \Crater\Models\User $user * @param \Crater\Models\TaxType $taxType * @return mixed */ public function update(User $user, TaxType $taxType) { if (BouncerFacade::can('edit-tax-type', $taxType) && $user->hasCompany($taxType->company_id)) { return true; } return false; } /** * Determine whether the user can delete the model. * * @param \Crater\Models\User $user * @param \Crater\Models\TaxType $taxType * @return mixed */ public function delete(User $user, TaxType $taxType) { if (BouncerFacade::can('delete-tax-type', $taxType) && $user->hasCompany($taxType->company_id)) { return true; } return false; } /** * Determine whether the user can restore the model. * * @param \Crater\Models\User $user * @param \Crater\Models\TaxType $taxType * @return mixed */ public function restore(User $user, TaxType $taxType) { if (BouncerFacade::can('delete-tax-type', $taxType) && $user->hasCompany($taxType->company_id)) { return true; } return false; } /** * Determine whether the user can permanently delete the model. * * @param \Crater\Models\User $user * @param \Crater\Models\TaxType $taxType * @return mixed */ public function forceDelete(User $user, TaxType $taxType) { if (BouncerFacade::can('delete-tax-type', $taxType) && $user->hasCompany($taxType->company_id)) { return true; } return false; } }