Laravel 4.2
I am trying to include pages depending on the page URL like so
@if(Request::path()=="project/$viewPro->id/about-project")
@include('projects.projectDetails.aboutProject')
@elseif(Request::path()=="project/$viewPro->id")
@include('projects.projectDetails.aboutProject')
@elseif(Request::path()=="project/$viewPro->id/project-images")
@include('projects.projectDetails.projectImages')
@endif
now the about-project is working fine but, when going to project-images it ignore the layout here is my ProjectsController
public function viewProject($id)
{
$vp = Projects::find($id);
return View::make('projects.viewProject', ['viewPro' => $vp]);
}
public function viewProjectImages($id)
{
$vpi = ProjectsImages::where('image_id', $id)->get();
return View::make('projects.projectDetails.projectImages', ['viewProImg' => $vpi]);
}
and here is the Route
//Projects Route
Route::get('our-projects', 'projectController@currentProjects');
Route::get('project/{id}', 'projectController@viewProject');
//Projects details
Route::get('project/{id}/about-project', 'projectController@viewProject');
Route::get('project/{id}/project-images', 'projectController@viewProjectImages');
Sign in to participate in this thread!
The Laravel portal for problem solving, knowledge sharing and community building.
The community