find($request->input('plan.data.id')); // Create subscription $user->newSubscription('main', $plan); // Update user storage limig $user->settings()->update([ 'storage_capacity' => $plan->features->first()->value ]); // Store invoice Invoice::create( get_invoice_data($user, $plan) ); return response('Done!', 204); } }