Laravel Developers,
After I submit my payment form, I get a 404 error message. When I check the database there is no update in the subscription document. Any suggestions? I've been at this for a while now and I feel like I'm missing something that should be obvious.
SubscriptionController.php
class SubscriptionController extends Controller
{
public function create(Request $request, Plan $plan)
{
$plan = Plan::findOrFail($request->get('plan'));
$request->user()
->newSubscription('main', $plan->stripe_plan)
->create($request->stripeToken);
return redirect()->route('home')
->with('success', 'Your plan subscribed successfully');
}
}
Here is my Route
Route::get('/plans', 'PlanController@index')->name('plans.index');
Route::get('/plan/{plan}', 'PlanController@show')->name('plans.show');