<!DOCTYPE html>
## About Laravel
Laravel is a web application framework with expressive, elegant syntax. We believe development must be an enjoyable and creative experience to be truly fulfilling. Laravel takes the pain out of development by easing common tasks used in many web projects, such as:
Application Setup
Requirements
- PHP version that is being used for the development of the application is 7.4.19.
- MYSQL version being used during the development is 5.7.33.
- You will need to install any local server like (XAMP, Laragon, Wamp) etc.
- You will need to install composer in your system as it is required to run a Laravel application.
For setting up Laravel project
Go to GitHub and move to your repository. Clone the code in the git repository. After cloning, open up the application code inside an IDE like VS Code and do the following.
Environment and Database Setup
Laravel environment settings have been saved in the .env.example
file. In this step, we configure the Application settings.
We need to fill in the following details to set the environment:
- App Name
- App URL:
http://xyz.com/(root directory folder name)
- Database Connection
- Database Host
- Database Port
- Database Name
- Database User Name
- Database Password
Create a new database inside MYSQL. Once everything is set, go to the application folder and open the terminal.
There is a database backup also available inside the project folder. If you import the backup, you can skip points 3 and 4.
Run the following commands to proceed:
- composer install
- php artisan optimize
- php artisan migrate
- php artisan db:seed
- php artisan serve
With composer install
it will install the required packages.
With php artisan optimize
it will clear cache and configurations.
With php artisan migrate
it will migrate database tables to your newly created database inside MYSQL.
With php artisan db:seed
it will update tables with data for users, roles, and permissions.
With php artisan serve
you will be able to run the project in a local environment.
Once the application is started, visit http://localhost:8000/login (the port can be different in your case).
After logging in, you will start seeing the response.
To login to the system use the following credentials
For Super Admin
- Email:
superadmin@example.com
- Password:
password
For Admin
- Email:
admin@example.com
- Password:
password
API Documentation
Middleware Flow
-
Device Check
Method: Middleware
Route: check.device
Description: Ensures the request is coming from a verified device.
-
Sanctum Authentication
Method: Middleware
Route: auth
Description: Protects routes requiring user authentication via Laravel Sanctum.
-
Additional Middleware
Method: Middleware
Route: auth, verified, permissions
Description: Ensures user authentication, email verification, and proper permissions.
Authentication Flow
-
Display Login Page
Method: GET
Route: /login
Description: Display login page.
Controller: AuthController@show
-
User Registration
Method: POST
Route: /auth/register
Description: Registers a new user.
Controller: AuthController@store
-
User Login
Method: POST
Route: /auth/login
Description: Authenticates a user.
Controller: AuthController@login
-
User Logout
Method: POST
Route: /auth/logout
Description: Logs out the user.
Controller: AuthController@logout
-
Retrieve Authenticated User
Method: GET
Route: /user
Description: Retrieves the authenticated user's information.
Controller: function (Request $request) { return $request->user(); }
User Management Flow
-
List Users
Method: GET
Route: /users
Description: Lists all users.
Controller: UserController@index
-
Create User
Method: GET
Route: /users/create
Description: Displays form to create a new user.
Controller: UserController@create
-
Store User
Method: POST
Route: /users
Description: Stores a new user.
Controller: UserController@store
-
Show User
Method: GET
Route: /users/{user}
Description: Shows a single user.
Controller: UserController@show
-
Edit User
Method: GET
Route: /users/{user}/edit
Description: Displays form to edit user information.
Controller: UserController@edit
-
Update User
Method: PUT
Route: /users/{user}
Description: Updates user information.
Controller: UserController@update
-
Delete User
Method: DELETE
Route: /users/{user}
Description: Deletes a user.
Controller: UserController@destroy
Permission Management Flow
-
List Permissions
Method: GET
Route: /permissions
Description: Lists all permissions.
Controller: PermissionController@index
-
Create Permission
Method: GET
Route: /permissions/create
Description: Displays form to create a new permission.
Controller: PermissionController@create
-
Store Permission
Method: POST
Route: /permissions
Description: Stores a new permission.
Controller: PermissionController@store
-
Show Permission
Method: GET
Route: /permissions/{permission}
Description: Shows a single permission.
Controller: PermissionController@show
-
Edit Permission
Method: GET
Route: /permissions/{permission}/edit
Description: Displays form to edit permission information.
Controller: PermissionController@edit
-
Update Permission
Method: PUT
Route: /permissions/{permission}
Description: Updates permission information.
Controller: PermissionController@update
-
Delete Permission
Method: DELETE
Route: /permissions/{permission}
Description: Deletes a permission.
Controller: PermissionController@destroy
Role Management Flow
-
List Roles
Method: GET
Route: /roles
Description: Lists all roles.
Controller: RoleController@index
-
Create Role
Method: GET
Route: /roles/create
Description: Displays form to create a new role.
Controller: RoleController@create
-
Store Role
Method: POST
Route: /roles
Description: Stores a new role.
Controller: RoleController@store
-
Show Role
Method: GET
Route: /roles/{role}
Description: Shows a single role.
Controller: RoleController@show
-
Edit Role
Method: GET
Route: /roles/{role}/edit
Description: Displays form to edit role information.
Controller: RoleController@edit
-
Update Role
Method: PUT
Route: /roles/{role}
Description: Updates role information.
Controller: RoleController@update
-
Delete Role
Method: DELETE
Route: /roles/{role}
Description: Deletes a role.
Controller: RoleController@destroy
-
Associate Permissions to Role
Method: POST
Route: /roles/rolePermissionAssociation/{id}
Description: Associates permissions to a role.
Controller: RoleController@association
-
Get Role Permissions
Method: GET
Route: /roles/getRolePermissions/{id}
Description: Retrieves permissions associated with a role.
Controller: RoleController@rolePermissions
Page Management Flow
-
List Pages
Method: GET
Route: /pages
Description: Lists all pages.
Controller: PageController@index
-
Create Page
Method: GET
Route: /pages/create
Description: Displays form to create a new page.
Controller: PageController@create
-
Store Page
Method: POST
Route: /pages
Description: Stores a new page.
Controller: PageController@store
-
Show Page
Method: GET
Route: /pages/{page}
Description: Shows a single page.
Controller: PageController@show
-
Edit Page
Method: GET
Route: /pages/{page}/edit
Description: Displays form to edit page information.
Controller: PageController@edit
-
Update Page
Method: PUT
Route: /pages/{page}
Description: Updates page information.
Controller: PageController@update
-
Delete Page
Method: DELETE
Route: /pages/{page}
Description: Deletes a page.
Controller: PageController@destroy
Configuration Management Flow
-
List Configurations
Method: GET
Route: /configurations
Description: Lists all configurations.
Controller: ConfigurationController@index
-
Create Configuration
Method: GET
Route: /configurations/create
Description: Displays form to create a new configuration.
Controller: ConfigurationController@create
-
Show Configuration
Method: GET
Route: /configurations/{configuration}
Description: Shows a single configuration.
Controller: ConfigurationController@show
-
Edit Configuration
Method: GET
Route: /configurations/{configuration}/edit
Description: Displays form to edit configuration information.
Controller: ConfigurationController@edit
-
Delete Configuration
Method: DELETE
Route: /configurations/{configuration}
Description: Deletes a configuration.
Controller: ConfigurationController@destroy
FAQ Management Flow
-
List FAQs
Method: GET
Route: /faqs
Description: Lists all FAQs.
Controller: FaqController@index
-
Create FAQ
Method: GET
Route: /faqs/create
Description: Displays form to create a new FAQ.
Controller: FaqController@create
-
Store FAQ
Method: POST
Route: /faqs
Description: Stores a new FAQ.
Controller: FaqController@store
-
Show FAQ
Method: GET
Route: /faqs/{faq}
Description: Shows a single FAQ.
Controller: FaqController@show
-
Edit FAQ
Method: GET
Route: /faqs/{faq}/edit
Description: Displays form to edit FAQ information.
Controller: FaqController@edit
-
Update FAQ
Method: PUT
Route: /faqs/{faq}
Description: Updates FAQ information.
Controller: FaqController@update
-
Delete FAQ
Method: DELETE
Route: /faqs/{faq}
Description: Deletes a FAQ.
Controller: FaqController@destroy
Application Log Management Flow
-
List Application Logs
Method: GET
Route: /application-logs
Description: Lists all application logs.
Controller: ApplicationLogController@index
-
Show Application Log
Method: GET
Route: /application-logs/{applicationLog}
Description: Shows a single application log.
Controller: ApplicationLogController@show