title: Array to string conversion Laravel 5.2
body: <p>I'm working on project, and I need help with converting array list to string.</p>
  
  <p>This is my controller:</p>
  
  <pre><code>public function editprofila($id)
  {
      $user = User::findOrFail($id);
      $gradovi = Grad::all();
  
      $nazivGrada = DB::table('grad')
          -&gt;select('grad.naziv_grada')
          -&gt;join('users', 'grad.id', '=', 'users.id_grada')
          -&gt;where('grad.id', '=', Auth::user()-&gt;id_grada)
          -&gt;get();
  
      if ($user-&gt;id == Auth::user()-&gt;id || Auth::user()-&gt;legenda == 1) {
          return view('korisnik.uredivanje_profila',
              compact('user', 'gradovi', 'nazivGrada')
          );
      }
  }
  </code></pre>
  
  <p>How can select one value from options by nazivGrada such as <em>eng. nameCity</em>?</p>
  
  <pre><code>&lt;select class="form-control" name="id_grada" id="id_grada"&gt;
  
    @foreach($gradovi as $grad)
  
      &lt;option value="{{$grad-&gt;id}}" selected=""&gt;{{$grad-&gt;naziv_grada}}&lt;/option&gt;
  
    @endforeach
  
    &lt;option value="{{Auth::user()-&gt;id_grada}}" selected="selected"&gt;{{''.$nazivGrada.''}}&lt;/option&gt;
  
  &lt;/select&gt;
  </code></pre>
  
  <p>My problem is that <code>$nazivGrada</code> is Array list like this,</p>
  
  <pre><code>[{"naziv_grada":"Rovinj"}]
  </code></pre>
  
  <p>and I get an error; <em>Array to string conversion</em>.</p>