Laravel blade page not working

  Sun 31 / 03 / 2024

  Posted by: NEERAJ

Category : Laravel

Tags : laravel , php laravel

Post Thumbnail
Description

my code not working showing only a blank page i am also trying (php artisan cache:clear) and (php artisan view:clear) but still same problem not showing anything if i am use @include then showing 500 error please help me what i do


View Code
                        welcome.blade.php------------------------code
👇
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
</head>
<body>
    <main>
        @yield('firstname')
    </main>
</body>
</html>



master.blade.php ----------------------------code

👇
@extends('welcome')

@section('firstname')

<h1>this is my name</h1>
    
@endsection


web.php-----------code
👇
<?php

use Illuminate\Support\Facades\Route;

Route::get('/', function () {
    return view('welcome');
});
                
  Answered by CDL

Neeraj, your code is fine but you placed your logic in opposite files.


Cut welcome blade stuff and paste it into the master blade file.

Similar cust master blade stuff and paste into the welcome blade file.


Then call the welcome blade in the route and it will work.


Let me know if you are still facing the issues.

  Comment   Share
0 Likes   0 Comments