Support the ongoing development of Laravel.io →
Configuration Views Blade

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');
Last updated 3 years ago.
0

The first section with blade includes, what file is that from?

0

Sign in to participate in this thread!

PHPverse

Your banner here too?

johnef johnef Joined 18 May 2016

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.

© 2025 Laravel.io - All rights reserved.