Hi guys so heres my situation, I am integrating stripe into my website which is built on the laravel 5.2 framework and when we issue a bill to someone we will first select if this is going to be a reoccurring bill or not, if it is then i show a drop down with all of the plans (using the id's of the plan) we currently have created in stripe, once a plan is selected I want it to auto fill in the form with the name as well as the price of the plan. I am currently making a call in my controller to retrieve all plans in our stripe account, then we iterate through the collection or array and grab out the id's of the plans and then passing the plan id's to the drop down menu that is in the view. However I need to be able to get the other information for the plan when a certain plan is selected so i can auto fill in the form, how can i do this?
I do have javascript ready to go to auto fill the form, i just dont know how to get the other values that I need such as name and price from the selected plan. I have a feeling im not using arrays correctly. Any help is appreciated.
Administration Controller
try{
            $stripePlanIdsServer = Plan::all()->data;
            $stripePlanIds = array();
            if($stripePlanIdsServer){
                foreach($stripePlanIdsServer as $stripePlanId){
                    $stripePlanIds[] = $stripePlanId->id;
                }
            }
        }catch (\Exception $e){
            return redirect()->route('users.administration.index')->with('error', $e->getMessage());
        }
        return view('users.administration.index', compact('stripePlanIdsServer', 'stripePlanIds'));
Administration View
<div class="row">
                                <div class="col-sm-4 text-center">
                                    <div class="form-group label-floating">
                                        {!! Form::label('reoccurring', 'Reoccurring') !!}
                                        </br>
                                        {!! Form::select('reoccurring', ['Yes'=>'Yes','No'=>'No'], null, ['class' => 'browser-default mdl-selectfield', 'placeholder' => 'Choose Option', 'id' => 'reoccurring'])!!}
                                    </div>
                                </div>
                                <div class="col-sm-4 text-center">
                                    <div id="planIdDiv" class="form-group label-floating" style="display: none;">
                                        {!! Form::label('planId', 'Plan ID (shows up on customers bank statement') !!}
                                        </br>
                                        {!! Form::select('planId', $stripePlanIds, null, ['class' => 'browser-default mdl-selectfield', 'placeholder' => 'Choose Option', 'id' => 'plan'])!!}
                                    </div>
                                </div>
                                <div class="col-sm-2 text-center">
                                    <div id="billStatusDiv" class="form-group label-floating" style="display: none;">
                                        {!! Form::label('billStatus', 'Bill Status') !!}
                                        </br>
                                        {!! Form::select('billStatus', ['Not Paid'=>'Not Paid','Paid'=>'Paid'], null, ['class' => 'browser-default mdl-selectfield', 'placeholder' => 'Choose Option', 'id' => 'billStatus'])!!}
                                    </div>
                                </div>
                                <div class="col-sm-2 text-center">
                                    <div id="organizationDiv" class="form-group label-floating" style="display: none;">
                                        {!! Form::label('organization', 'Assign Bill To') !!}
                                        </br>
                                        {!! Form::select('organization', $organization, null, ['class' => 'browser-default mdl-selectfield', 'placeholder' => 'Choose Option'])!!}
                                    </div>
                                </div>
                            </div>
                            <div class="row">
                                <div class="col-md-6">
                                    <div id="priceDiv" class="form-group label-floating" style="display: none;">
                                        <label class="control-label">Amount to Bill (in dollars)</label>
                                        <input id="price" type="text" name="price" class="form-control">
                                    </div>
                                </div>
                                <div class="col-md-4">
                                    <div id="productNameDiv" class="form-group label-floating" style="display: none;">
                                        <label class="control-label">Product</label>
                                        <input id="productName" type="text" name="productName" class="form-control">
                                    </div>
                                </div>
                            </div>

