本文整理汇总了PHP中Laravel\Spark\Spark::promotion方法的典型用法代码示例。如果您正苦于以下问题:PHP Spark::promotion方法的具体用法?PHP Spark::promotion怎么用?PHP Spark::promotion使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Laravel\Spark\Spark
的用法示例。
在下文中一共展示了Spark::promotion方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: showRegistrationForm
/**
* Show the application registration form.
*
* @param Request $request
* @return Response
*/
public function showRegistrationForm(Request $request)
{
if (Spark::promotion() && !$request->has('coupon')) {
// If the application is running a site-wide promotion, we will redirect the user
// to a register URL that contains the promotional coupon ID, which will force
// all new registrations to use this coupon when creating the subscriptions.
return redirect($request->fullUrlWithQuery(['coupon' => Spark::promotion()]));
}
return view('spark::auth.register');
}
示例2: canBeRedeemed
/**
* {@inheritdoc}
*/
public function canBeRedeemed($code)
{
return $this->valid($code) && Spark::promotion() !== $code;
}
示例3: customizeSubscriptionPlans
/**
* Customize the subscription plans for the application.
*
* @return void
*/
protected function customizeSubscriptionPlans()
{
Spark::promotion('50-percent-off-membership');
Spark::free()->features(['Learn to code on your own time!', 'New content offered weekly!', 'Learn best practices and current industry standards!']);
Spark::plan('Premium - Monthly', 'jyrone-parker-blog-monthly')->price(9.99)->trialDays(7)->features(['Get access to wider array of tutorials!', 'Get added to my email list!', 'Get access to my virtual office hours!']);
Spark::plan('Premium - Yearly', 'jyrone-parker-yearly')->price(99)->yearly()->trialDays(7)->features(['Save over 17% off regular membership!', 'Free T-Shirt!', '10% discount off everything in the store!']);
}