The issue:
Tabs are not being processed properly when including templates using Blade (in a Laravel app) after viewing the page source code in the browser
default.blade.php:
<html>
    <head>
        @include('includes.head')
    </head>
    <body>
    </body>
</html>
head.blade.php:
<meta charset="utf-8">
<meta name="description" content="">
<meta name="Test" content="">
What it looks like when viewing source on the browser:
<html>
    <head>
        <meta charset="utf-8">
<meta name="description" content="">
<meta name="Test" content="">
    </head>
    <body>
    </body>
</html>
As you can see, the last two meta tags are for some reason being tabbed backwards instead of aligning with the first meta tag. What's going on?
Just adding @Andrei Lupuleasa answer, blade consider indentation from your master layout. so it is taking indentation from master.blade.php. please put 2 tab space in your head.blade.php.
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
Put tabs in your head.blade.php.
     <meta charset="utf-8">
     <meta name="description" content="">
     <meta name="Test" content="">
First line is indented ok because it uses the indentation from default.blade.php, the tabs before @include...
From what I see there is also a problem with blade indentation:
https://laracasts.com/discuss/channels/laravel/problem-with-indentation-in-blade-views
So i suggest to remove the indentation from layout:
<html>
    <head>
@include('includes.head')
    </head>
    <body>
    </body>
</html>
It is not pretty but it will solve your problem.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With