Skip to content

feat(RoleController): add read-only Role endpoints - #10

Closed
NegK01 with Copilot wants to merge 1 commit into
mainfrom
copilot/sub-pr-9
Closed

feat(RoleController): add read-only Role endpoints#10
NegK01 with Copilot wants to merge 1 commit into
mainfrom
copilot/sub-pr-9

Conversation

Copilot AI commented Mar 23, 2026

Copy link
Copy Markdown

Adds Role model, migration, seeder, and a read-only RoleController as part of the Flotilla Vehicular API resource layer.

Changes

  • Role model (app/Models/Role.php) — Eloquent model with roles table, name fillable, and hasMany(User::class) relation.
  • Migration (create_roles_table) — id, name (unique, 50 chars), timestamps.
  • RoleSeeder — seeds Admin, Operator, Driver using firstOrCreate.
  • RoleController — read-only; exposes:
    • GET /api/roles — paginated list (10/page, ordered by latest)
    • GET /api/roles/{role} — single role by implicit route binding
  • routes/api.php — registers role routes alongside existing users apiResource + soft-delete restore route.
  • User model — added belongsTo(Role::class) relation and related HasMany associations (vehicleRequests, approvedVehicleRequests, trips).

Write/update (store, update, destroy) operations are stubbed out and commented pending future requirements.


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Copilot AI changed the title [WIP] Add role controller implementation feat(RoleController): add read-only Role endpoints Mar 23, 2026
Copilot AI requested a review from NegK01 March 23, 2026 17:32
Base automatically changed from feature/RoleController to main March 23, 2026 17:53
@NegK01 NegK01 closed this Mar 23, 2026
@NegK01
NegK01 deleted the copilot/sub-pr-9 branch March 23, 2026 18:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants