Step 1: Install Laravel 5.7 Project
To install a Laravel project, use the following command:
This command will create a new Laravel project named blog.
Step 2: Set Up Database Connection
In your .env file, you will need to define the database connection:
Ensure your MySQL database is running and that you have created the management_system database before proceeding.
Step 3: Define Routes
In the routes/web.php file, define a route for displaying user data:
This route will call the usertotal method in the HomeController.
Step 4: Controller - HomeController.php
In the HomeController.php file, define the usertotal method to fetch the authenticated user's details and pass it to the view.
This method fetches the currently authenticated user and passes it to the user view in the password folder.
Step 5: Create the View (resources/views/password/user.blade.php)
In the resources/views/password/user.blade.php file, and create the HTML structure for displaying user data in a table format.
Key Points in the Code:
-
User Data: The user data fetched by
Auth::user()is displayed in the table. You can customize this to display additional user attributes as needed. -
Table Structure: A responsive table is used to display user details such as
ID,Name,Email,Profile User,Date Join, andUpdate Join. -
Pagination: If you want to handle a large number of users, consider implementing pagination in the controller and view.

