title: Laravel 5 passing database query from controller to view
body: <p>I'm new to Laravel 5 and MVC frameworks in general. I having trouble getting results from a database query and passing it to my blade view. Here is what I have for a controller function ...</p>
  
  <pre><code>public function show(Project $project)
  {
  $technologies = DB::select('select * from technologies where id = ?', [$project-&gt;technology_id]);
  return view('projects.show', compact('project','technologies'));
  }
  </code></pre>
  
  <p>and my view is ...</p>
  
  <pre><code>@section('content')
     &lt;h2&gt;{{ $project-&gt;name }}&lt;/h2&gt;
  
      @if ( !technologies() )
          no technologies.
      @else
          &lt;ul&gt;
              @foreach( $technologies as $technology )
                  &lt;li&gt;&lt;a href="#"&gt;{{ $technology-&gt;slug }}&lt;/a&gt;&lt;/li&gt;
              @endforeach
          &lt;/ul&gt;
      @endif
  @endsection
  </code></pre>
  
  <hr>
  
  <p>Thanks for your help</p>