Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create Role Model #25

Closed
2 of 6 tasks
Lapotor opened this issue Nov 1, 2023 · 0 comments · Fixed by #65 · May be fixed by #97
Closed
2 of 6 tasks

Create Role Model #25

Lapotor opened this issue Nov 1, 2023 · 0 comments · Fixed by #65 · May be fixed by #97
Milestone

Comments

@Lapotor
Copy link
Collaborator

Lapotor commented Nov 1, 2023

Description:

This task involves creating the Role model in the Laravel project. The Role model will serve as a representation of user roles within the application. Roles define the permissions and access levels that users have. This model will be responsible for storing role-related information in the database and providing methods for interacting with roles.

Model Decleration
  Role:
    type: object
    required:
      - id
      - created_at
      - updated_at
      - name
      - permissions
    properties:
      id:
        type: integer
      created_at:
        type: string
        format: date-time
      updated_at:
        type: string
        format: date-time
      name:
        type: string
      permissions:
        type: object

Tasks:

  • Generate the Role model file.
  • Define the attributes and relationships for the Role model.
  • Set up the database migration for the roles table.
  • Implement any necessary validation rules for role attributes.
  • Create methods for querying and managing roles.
  • Write unit tests to ensure the functionality of the Role model.

Acceptance Criteria:

  • The Role model file is created and located in the appropriate directory.
  • The model defines attributes such as id, name, created_at, updated_at, and any other relevant fields.
  • The model has relationships defined as needed (e.g., with users).
  • The database migration for the roles table is created and can be run to create the corresponding database table.
  • Validation rules are in place to ensure data integrity for role attributes.
  • Methods for querying and managing roles (e.g., creating, updating, deleting) are implemented and functional.
  • Unit tests are written to cover the methods and functionality of the Role model.

Additional Information:

  • Refer to the project's coding standards and conventions for naming conventions and style guidelines while creating the Role model.
@Lapotor Lapotor added this to the v1.0.0 milestone Nov 1, 2023
whyauthentic pushed a commit that referenced this issue Dec 12, 2023
Introduce the
[`saits/laravel-permission`](https://github.com/spatie/laravel-permission)
PHP Composer package to the project and initialize it. This package,
designed for Laravel, offers a flexible and easy-to-use permission
system, providing powerful permission management features within the
Laravel application.

Closes: #25

Signed-off-by: Valentin Sickert <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
1 participant