0

i am making a basic website and i am trying to make function that will show the content of the file "showcase" in "inc" folder only on a homepage, the page seems to work fine without it....

<body>
    @include("inc.navbar")
    <div class="container">
        <div class="row">
            <div class="col-md-8 col-lg-8">
                @yield("content")

            </div>
            <div class="col-md-4 col-lg-4">
                @include("inc.sidebar")
            </div>
        </div>
    </div>
</body>

enter image description here

but when i add a function:

<body>
    @include("inc.navbar")
    <div class="container">
        @if (request::is("/"))
        @include('inc.showcase')
        @endif
    
        <div class="row">
            <div class="col-md-8 col-lg-8">
                @yield("content")

            </div>
            <div class="col-md-4 col-lg-4">
                @include("inc.sidebar")
            </div>
        </div>
    </div>
</body>

it shows this error: enter image description here

I suspect it must be some path problem, but i havent found any issue with path name or anything... any ideas? Thanks in advance for any reply.

1 Answers1

2

Try to use Request::is, Request is a class.

  • thats what i did here no? can you please elaborate? Possible include a snippet, i am not sure i am following completely tbh.... – Billy But Whole Nov 10 '19 at 20:49
  • Changing first letter to Capital actually worked! Thanks a lot, i feel stupid now, but lesson learned, thank you for your input. – Billy But Whole Nov 10 '19 at 22:37