Aronaman's avatar

blade error

i am in this directorate

resources\views/Admin/org/index.blade.php

i am try to include in my blade file (org/index.blade.php)

@include(Views.Org.generalCreate)

the problem is " Use of undefined constant Views - assumed 'Views' (this will throw an Error in a future version of PHP)"

0 likes
3 replies
Sinnbeck's avatar
Sinnbeck
Best Answer
Level 102

You forgot ''

@include('Views.Org.generalCreate')
tykus's avatar

Your view should be a dot-separated string which maps to the path to the view under the resources/views directory, assuming you have the included view in resources/views/org/index.blade.php

@include('org.index')
Sinnbeck's avatar

Be aware that you don't include the views dir in your path (like @tykus pointed out). I assume you meant to write. Also be careful with case. If you are working on windows now, it might work but linux will break. I suggest all lowercase for views.

@include('admin.org.general_create')

Please or to participate in this conversation.