本文整理汇总了PHP中Plan::updateOrCreate方法的典型用法代码示例。如果您正苦于以下问题:PHP Plan::updateOrCreate方法的具体用法?PHP Plan::updateOrCreate怎么用?PHP Plan::updateOrCreate使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Plan
的用法示例。
在下文中一共展示了Plan::updateOrCreate方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: run
public function run()
{
Plan::updateOrCreate(['name' => 'Free'], array('name' => 'Free', 'interval' => 'permanent', 'interval_count' => 0, 'amount' => 0, 'braintree_plan_id' => null, 'description' => '<ul class="list-group">
<li class="list-group-item">We host the software</li>
<li class="list-group-item">Access all free widgets</li>
<li class="list-group-item">Community support</li>
</ul>
<p><small>Just create an account, and use the free functionalities without any install.</small></p>'));
Plan::updateOrCreate(['name' => 'Premium'], array('name' => 'Premium', 'interval' => 'month', 'interval_count' => 12, 'amount' => 9, 'braintree_plan_id' => $_ENV['BRAINTREE_PREMIUM_PLAN_ID'], 'description' => '<ul class="list-group">
<li class="list-group-item">We host the software</li>
<li class="list-group-item">Access all premium widgets</li>
<li class="list-group-item">Email support</li>
</ul>
<p><small>Use the dashboard without any restrictions.</small></p>'));
/* Send message to console */
error_log('PlanSeeder | All Plans updated');
}