Bjorn
Bjorn

Reputation: 43

Laravel won't use blades

I am trying to create a blade profile in laravel. I created "master.blade.php" in "xampp\htdocs\laravel5-learning\resources\views\layouts" This contains:

<!DOCTYPE html>
<html>
<head>
<title>@yield('title')</title>
</head>
<body>
<div class="container">
@yield('content')
</div>
</body>
</html>

Then i have a file "welcome.blade.php" in the direction "xampp\htdocs\laravel5-learning\resources\views". It contains:

@extends('layouts.master')

@section('title')
Welcome!
@endsection

@section('content')
This is the content!
@endsection

This won't work however. I have also a test php file in there, this works when running localhost\laravel5-learning\resources\views\test.php

I got apache and a sql server running using xampp.

Anybody an idea? I feel like i am missing an important step for using Laravel. I installed xampp, then installed Laravel using composer with the line in the htdocs folder: composer create-project laravel/laravel laravel5-learning

If i go to http://localhost/laravel5-learning/resources/views/welcome.blade.php the actual code shows: @extends('layouts.master') @section('title') Welcome! @endsection @section('content') This is the content! @endsection

Anybody an idea?

Upvotes: 2

Views: 359

Answers (1)

Bjorn
Bjorn

Reputation: 43

Found the solution. I was running the actual code, but i should run the index.html file in the public folder.

I very big rookie mistake i guess.

Upvotes: 0

Related Questions