If you are not sure whether your Blade partial file actually would exist, you may use these condition commands:
This will load header only if Blade file exists
@includeIf('partials.header')
This will load header only for user with role_id 1
@includeWhen(auth()->user()->role_id == 1, 'partials.header')
This will try to load adminlte.header, if missing - will load default.header
@includeFirst('adminlte.header', 'default.header')
Enjoyed This Tip?
Get access to all premium tutorials, video and text courses, and exclusive Laravel resources. Join our community of 10,000+ developers.
Recent Courses
Testing in Laravel 13 For Beginners
26 lessons
1 h 41 min read
Queues in Laravel 13
18 lessons
1 h 12 min read
How to Structure Laravel 13 Projects
16 lessons
1 h 32 min read