Creating new pages documentation incorrect

Closed
Vanguard - Advanced PHP Login and User Management Vanguard - Advanced PHP Login and User Management October 28, 2018
Login to reply
Milos Stojanovic Support Agent
1 week ago
Closed due to inactivity.
Milos Stojanovic Support Agent
3 weeks ago

Hey Thomas,

1) The yourwebsite.com/active-users is the correct URL if you have configured the web server properly (meaning that your root is inside the /public Vanguard folder). I would recommend you to go through the "Application URL" section in Installation article for more info.

2) The code looks OK but there might be some other issue. Can you please enable development mode like it is explained in the Development Mode article and let me know what error you get?

Btw, remember that that article is just an example of how you can create a new page in basically any Laravel application and that you have to be familiar with Laravel to be able to customize or extend the Vanguard.

- Milos

Thomas Kälber
3 weeks ago

Hi Milos,

I tried to create new pages.
But the top "Creating new page" included in the documentation is incorrect, I believe it belongs to the "old version" of Vanguard.

First thing is:
"To verify that this code is actually working, you should go to yourwebsite.com/active-users and you should see following text on your screen:"
As I found out this must be yourwebsite.com/public/active-users

Second thing:
When going on step-by-step with the tutorial, the result is:
"namespace Vanguard\Http\Controllers\Web; use Vanguard\Http\Controllers\Controller; use Vanguard\User; class ActiveUsersController extends Controller { public function index() { // Fetch users from database $users = User::join('sessions', 'users.id', '=', 'sessions.user_id') ->select('users.*') ->distinct() ->get(); // Uncomment the following line if you want to see the info you get from the database // dd($users); // Load appropriate view for displaying the users // Note: compact('users') is the same as ['users' => $users] return view('user.active-users', compact('users')); } }
Whoops, something went wrong..."

Please check this. I'm not able to create a new page...

Regards,
Thomas