Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

Why blade file in laravel is not displaying?

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:

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

<?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

>Solution :

remove this function from HomeController

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

and try this url

localhost/myaccount/public

Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading