Home > Back-end >  Why blade file in laravel is not displaying?
Why blade file in laravel is not displaying?

Time:12-04

I am new to laravel, I am trying display myaccount page using blade file in laravel. myaccount.blade.php is located in resources/views/myaccount.blade.php myaccount.blade.php

Route in web.php as:

Route::get('/myaccount', 'HomeController@myaccount');

Then HomeController.php as:

<?php

namespace App\Http\Controllers;

use Illuminate\Http\Request;
use App\User;
use Illuminate\Support\Facades\Auth;
use DB;
class HomeController extends Controller
{
    
    public function __construct()
    {
        $this->middleware('auth');
    }

    public function index()
    {
        return view('home');
    }
    public function registerUser(Request $request)
    {
        dd($request->all());
    }
    public function myaccount()
    {
        return view('myaccount');
    }
   
}

What my output shows:

Output

CodePudding user response:

remove this function from HomeController

public function __construct()
{
    $this->middleware('auth');
}

and try this url

localhost/myaccount/public

  • Related