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 ...
public function show(Project $project)
{
$technologies = DB::select('select * from technologies where id = ?', [$project->technology_id]);
return view('projects.show', compact('project','technologies'));
}
and my view is ...
@section('content')
<h2>{{ $project->name }}</h2>
@if ( !technologies() )
no technologies.
@else
<ul>
@foreach( $technologies as $technology )
<li><a href="#">{{ $technology->slug }}</a></li>
@endforeach
</ul>
@endif
@endsection
Thanks for your help