當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Spark::teamPlans方法代碼示例

本文整理匯總了PHP中Laravel\Spark\Spark::teamPlans方法的典型用法代碼示例。如果您正苦於以下問題:PHP Spark::teamPlans方法的具體用法?PHP Spark::teamPlans怎麽用?PHP Spark::teamPlans使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Laravel\Spark\Spark的用法示例。


在下文中一共展示了Spark::teamPlans方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: validatePlanEligibility

 /**
  * Validate that the plan is eligible based on team restrictions.
  *
  * @param  \Illuminate\Validation\Validator  $valdiator
  * @return void
  */
 protected function validatePlanEligibility($validator)
 {
     $plan = Spark::teamPlans()->where('id', $this->plan)->first();
     // If the desired plan is free, we will always need to let the user switch to that
     // plan since we'll want the user to always be able to cancel this subscription
     // without preventing them. So, we will just return here if it's a free plan.
     if (!$plan || $plan->price === 0) {
         return;
     }
     $this->callCustomCallback($validator, $plan);
     // If the user is ineligible for a plan based on their team member or collaborator
     // count, we will prevent them switching to this plan and send an error message
     // back to the client informing them of this limitation and they can upgrade.
     if (!$this->teamIsEligibleForPlan($this->route('team'), $plan)) {
         $validator->errors()->add('plan', 'This team has too many team members for the selected plan.');
     }
 }
開發者ID:defenestrator,項目名稱:groid,代碼行數:23,代碼來源:DeterminesTeamPlanEligibility.php

示例2: availablePlans

 /**
  * Get the available billing plans for the given entity.
  *
  * @return \Illuminate\Support\Collection
  */
 public function availablePlans()
 {
     return Spark::teamPlans();
 }
開發者ID:defenestrator,項目名稱:groid,代碼行數:9,代碼來源:Team.php

示例3: all

 /**
  * Get the all of the team plans defined for the appliation.
  *
  * @return Response
  */
 public function all()
 {
     return response()->json(Spark::teamPlans());
 }
開發者ID:defenestrator,項目名稱:groid,代碼行數:9,代碼來源:TeamPlanController.php

示例4: plan

 /**
  * Get the Spark plan associated with the request.
  *
  * @return \Laravel\Spark\Plan
  */
 public function plan()
 {
     return Spark::teamPlans()->where('id', $this->plan)->first();
 }
開發者ID:defenestrator,項目名稱:groid,代碼行數:9,代碼來源:CreateSubscriptionRequest.php


注:本文中的Laravel\Spark\Spark::teamPlans方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。