Airport Guide Documentation

RoleController extends BaseController
in package

Role Controller

This controller manages comprehensive role-based access control operations including role CRUD, permission management, role-permission synchronization, and role listing. It provides functionality for managing user roles with permission assignments, search capabilities, and role-based access control for the security system.

Table of Contents

Methods

__construct()  : void
Create a new RoleController instance.
create()  : View
Show the form for creating a new role.
destroy()  : RedirectResponse
Remove the specified role from storage.
edit()  : View
Show the form for editing the specified role.
index()  : View
Display a listing of roles with search functionality and pagination.
show()  : View
Display detailed information for a specific role.
store()  : RedirectResponse
Store a newly created role in storage.
update()  : RedirectResponse
Update the specified role in storage.

Methods

__construct()

Create a new RoleController instance.

public __construct() : void

Applies middleware to check permissions for role management. Ensures only authorized users can access role management functionality.

create()

Show the form for creating a new role.

public create(Request $request) : View

Displays the role creation form with permission selection options. Loads all available permissions for assignment to the new role. Provides interface for adding new roles with comprehensive permission management.

Parameters
$request : Request
Return values
View

destroy()

Remove the specified role from storage.

public destroy(int $id) : RedirectResponse

Deletes the role record and provides appropriate feedback message. Handles role deletion with proper error handling and database cleanup. Removes role and associated permission relationships.

Parameters
$id : int

Role ID

Return values
RedirectResponse

edit()

Show the form for editing the specified role.

public edit(int $id) : View

Displays the role editing form with current permission assignments. Loads existing role data and all available permissions for modification. Provides interface for updating roles with permission management.

Parameters
$id : int

Role ID

Return values
View

index()

Display a listing of roles with search functionality and pagination.

public index(Request $request) : View

Provides a paginated list of roles with comprehensive search capabilities. Supports filtering by role name and includes sortable columns for role management. Displays roles in descending order by ID with configurable pagination.

Parameters
$request : Request
Return values
View

show()

Display detailed information for a specific role.

public show(int $id) : View

Shows comprehensive role information including all assigned permissions. Retrieves role-permission relationships and displays them in a structured format. Provides complete role details for administrative review.

Parameters
$id : int

Role ID

Return values
View

store()

Store a newly created role in storage.

public store(Request $request) : RedirectResponse

Validates role data and creates a new role record with permission assignments. Handles role-permission synchronization and provides appropriate feedback message. Creates both role and permission records with proper user tracking.

Parameters
$request : Request
Return values
RedirectResponse

update()

Update the specified role in storage.

public update(Request $request, int $id) : RedirectResponse

Validates role data and updates the role record with new permission assignments. Handles role-permission synchronization and provides appropriate feedback message. Updates both role information and permission relationships.

Parameters
$request : Request
$id : int

Role ID

Return values
RedirectResponse

        
On this page

Search results