当我使用skipTrial()交换计划但跳过计划的试用期。我在下面给出了一些错误。
控制器
public function skipTrialUpdate()
{
$user = Auth::user();
$user->subscription('main')->skipTrial()->swap(Input::get('plan'));
return redirect(url('/home'))->with('skipTrialUpdatedNotice', 'You skipped trial and plan changed. Thanks');
}
错误
BadMethodCallException in Builder.php line 2258: Call to undefined method Illuminate\Database\Query\Builder::skipTrial()
详情
in Builder.php line 2258
at Builder->__call('skipTrial', array())
at Builder->skipTrial()
at call_user_func_array(array(object(Builder), 'skipTrial'), array()) in Builder.php line 1340
at Builder->__call('skipTrial', array())
at Builder->skipTrial()
at call_user_func_array(array(object(Builder), 'skipTrial'), array()) in Model.php line 3493
at Model->__call('skipTrial', array()) in SubscriptionController.php line 37
at Subscription->skipTrial() in SubscriptionController.php line 37
at SubscriptionController->skipTrialUpdate()
at call_user_func_array(array(object(SubscriptionController), 'skipTrialUpdate'), array()) in Controller.php line 80
at Controller->callAction('skipTrialUpdate', array()) in ControllerDispatcher.php line 146
at ControllerDispatcher->call(object(SubscriptionController), object(Route), 'skipTrialUpdate') in ControllerDispatcher.php line 94
at ControllerDispatcher->Illuminate\Routing\{closure}(object(Request))
at call_user_func(object(Closure), object(Request)) in Pipeline.php line 52
at Pipeline->Illuminate\Routing\{closure}(object(Request))
at call_user_func(object(Closure), object(Request)) in Pipeline.php line 103
at Pipeline->then(object(Closure)) in ControllerDispatcher.php line 96
at ControllerDispatcher->callWithinStack(object(SubscriptionController), object(Route), object(Request), 'skipTrialUpdate') in ControllerDispatcher.php line 54