Creating a New Page NOT WORKING

Closed
Vanguard - Advanced PHP Login and User Management Vanguard - Advanced PHP Login and User Management July 17, 2018
Login to reply
Milos Stojanovic Support Agent
5 years ago

Hey Shurik,

If you check the Creating a New Page article you will see that the second paragraph says: "The page we are going to add will be a simple page that will display the list of all users with active sessions."

This means that only users with active sessions will be displayed on that page. It doesn't matter how many users you have created so there are no problems with it.

- Milos

Shurik Kravchenko commented privately
Shurik Kravchenko
5 years ago

Hey, i have noticed one more problem, on https://learntohack.me/active-users i can only see 1 user (me) but i created 3 users... and i see them in Users section

Milos Stojanovic Support Agent
5 years ago

Vanguard is an admin panel so you should not be able to access the admin panel if you are not authenticated.

You can create new pages that are not part of the admin panel and re-use the Vanguard stylesheet for those.

I would recommend you to read through the Laravel documentation to learn more about how it works, how to create new views, view layouts etc.

- Milos

Shurik Kravchenko
5 years ago

And how can i add Vanguards design?

Milos Stojanovic Support Agent
5 years ago

Hey,

As you can see inside the controller's construction there are the following lines of code

public function __construct()
{        
// Allow access to authenticated users only.
    $this->middleware('auth');
    // Allow access to users with 'users.manage' permission.
    $this->middleware('permission:users.manage');
}

If you remove them (or the whole __construct method in this case) you will allow access for NON-authenticated users too.

- Milos

Shurik Kravchenko
5 years ago

One more question, i have created this page, HOW can i allow NON registered users to access it?

Milos Stojanovic Support Agent
5 years ago

No problem! I'm glad you fixed it. :)

- Milos

Shurik Kravchenko
5 years ago

Well i have Fixed it. i did not noticed that i need to add "use Vanguard\User;"

Sorry =)

Milos Stojanovic Support Agent
5 years ago

Hey,

It means that you haven't imported the User class. Notice the following code at the top of the code snippet in Creating a New Page article:

use Vanguard\User;

- Milos

Shurik Kravchenko
5 years ago

Hey,

Heres the error:


"Class 'Vanguard\Http\Controllers\Web\User' not found"

Milos Stojanovic Support Agent
5 years ago

Hey Shurik,

There is probably some minor mistake. Can you please enable the Development Mode as it is explained inside the docs and send me the error you are getting?

- Milos


Shurik Kravchenko
5 years ago

Hello, i do all like in https://milos.support-hub.io/articles/creating-a-new-page-in-vanguard

and still got "Something went wrong! :(" Error...