title: Laravel and Modals: Passing unique @foreach value into modal form?
body: <p>I have a list of job postings on a page. For each posting, I have a button called 'send to a friend'. Clicking the button pulls up a modal with a form where you can input your friend's email, and submit the form.</p>
  
  <p>How can I pull the related job posting name to my form? {{$posting->name}}</p>
  
  <p><strong>Job postings page:</strong></p>
  
  <pre><code>@foreach ($postings as $posting)
  
                    &lt;a href="postings/{{ $posting-&gt;id }}"&gt; &lt;p&gt; {{ $posting-&gt; short_desc }} &lt;/p&gt; &lt;/a&gt;
                    &lt;p&gt; {{ $posting-&gt;location }} | {{ $posting-&gt;duration }} &lt;/p&gt;
  
                    &lt;button type="button" class="btn btn-outline" data-toggle="modal" href="postings/sendfriend" value="{{ $posting-&gt;short_desc }}" data-target="#sendfriend" style="background-color: #004AAE; color: #FFF; font-family: Lato; border-radius: 10px;"&gt;Send to a friend&lt;/button&gt;
  
  @endforeach
  
  @include('postings.sendfriend')
  </code></pre>
  
  <p><strong>Modal:</strong></p>
  
  <pre><code>&lt;div id="sendfriend" class="modal fade" role="dialog"&gt;
  &lt;div class="modal-dialog"&gt;
  
  
  &lt;div class="modal-content"&gt;
      &lt;div class="modal-header"&gt;
        &lt;button type="button" class="close" data-dismiss="modal"&gt;&amp;times;&lt;/button&gt;
        &lt;h4 class="modal-title"&gt;Invite a friend to apply for this rotation&lt;/h4&gt;
      &lt;/div&gt;
        &lt;div class="modal-body"&gt;  
          &lt;form class="form-horizontal" method="post" action="{{ action('FriendController@store') }}"&gt;
     &lt;div class="form-group"&gt;
      &lt;label class="control-label col-sm-2" for="email"&gt;Email:&lt;/label&gt;
      &lt;div class="col-sm-10"&gt;
        &lt;input type="email" class="form-control" id="email" placeholder="Enter friend's email"&gt;
      &lt;/div&gt;
    &lt;/div&gt;
  
    &lt;button type="submit" class="btn btn-outline"&gt; Share the love &lt;/button&gt;
  
  &lt;/div&gt;&lt;/div&gt;
  &lt;/form&gt;&lt;/div&gt;&lt;/div&gt;
  </code></pre>
  
  <p><strong>Friend controller:</strong></p>
  
  <pre><code>public function store() {
    $friend = new Friend;
    $friend-&gt;email = request('email');
    $friend-&gt;company = $posting-&gt;name; //Something like this
  }
  </code></pre>