当前位置: 首页>>代码示例>>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;未经允许,请勿转载。