Answer the question
In order to leave comments, you need to log in
Can Laravel check for the presence of a mapping?
In the display I write: @include("...")
Accordingly, I set the path to the display with a dot as a separator, as is customary in Laravel. Of course, if no view is found, a "View not found" error pops up. I can check the existence of the file using standard php tools, this is not a problem. The question is, does Laravel already have a means to check if a mapping exists in a folder, or to disable this error so that if the mapping is not found, it simply won't be connected?
Answer the question
In order to leave comments, you need to log in
Add to the tags "I don't read the documentation"
use Illuminate\Support\Facades\View;
if (View::exists('emails.customer')) {
//
}
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question