Support the ongoing development of Laravel.io →
posted 10 years ago
Views
Last updated 2 years ago.
0

For your controller I suppose you get all your projects like this

return View::make('')->with('projects', $projects); // Just as example

And in the view you should do

@foreach ( $projects as $project )
<a href="{{ route('project.show', $project->id) }}">{{ HTML::image($project->image) }}</a>
@endforeach

And in route you can do this

Route::get('project/{id}', array('as' => 'project.show', 'uses' => 'PortfolioController@show'));

For the show controller

public function show($id) {
    $project = Project::find($id);

    return View::make('')->with('project', $project);
}
Last updated 2 years ago.
0

It works! Thank you very much.

Last updated 2 years ago.
0

Sign in to participate in this thread!

Eventy

Your banner here too?

jonaweb jonaweb Joined 22 Apr 2014

Moderators

We'd like to thank these amazing companies for supporting us

Your logo here?

Laravel.io

The Laravel portal for problem solving, knowledge sharing and community building.

© 2024 Laravel.io - All rights reserved.