First off, thank you for considering contributing to Lara Dashboard! It's people like you that make Lara Dashboard such a great tool. This document provides guidelines and steps for contributing.
By participating in this project, you are expected to uphold our Code of Conduct. Please report unacceptable behavior to manirujjamanakash@gmail.com.
Before creating bug reports, please check the issue list as you might find that you don't need to create one. When you are creating a bug report, please include as many details as possible.
Enhancement suggestions are tracked as GitHub issues. Create an issue and provide the necessary information regarding the enhancement.
Pull requests are the best way to propose changes to the codebase. We actively welcome your PRs.
When contributing code to Lara Dashboard, please follow these guidelines:
-
Separation of Concerns
- View/controller logic should be separated in most cases
- Business logic should reside in Service classes
- Controllers should be thin and primarily handle HTTP requests and responses
-
Validation
- All request validation should be in dedicated classes in
Http/Requests/directory - Never validate directly in controllers
- All request validation should be in dedicated classes in
-
Internationalization (i18n)
- All user-facing strings should use Laravel's translation functions (
__()or@lang()) - New strings should be added to the appropriate translation files
- All user-facing strings should use Laravel's translation functions (
-
Responsive Design
- All UI components must be responsive and work on mobile devices
- Test your changes on multiple screen sizes before submitting
-
Theme Support
- Ensure all UI changes work in both light and dark modes
- Use Tailwind's dark mode variants where appropriate
-
Authorization
- All actions should be properly secured with appropriate permissions
- Use our permission system consistently throughout the code
-
Extensibility
- If implementing functionality that might be useful for extension, create action/filter hooks
- Use the
ld_do_action()andld_apply_filters()functions for extension points
-
PHP Code Style
- Follow PSR-12 coding standards
- Use type hints for parameters and return types
- Use strict typing where possible
- Document classes and methods with PHPDoc comments
-
JavaScript and CSS
- Follow the existing code style
- Use ES6 features when appropriate
- Prefer Tailwind classes over custom CSS
-
Naming Conventions
- Controllers: Plural, PascalCase (e.g.,
UsersController) - Models: Singular, PascalCase (e.g.,
User) - Services: Singular with Service suffix, PascalCase (e.g.,
UserService) - Database: Use snake_case for tables and columns
- Controllers: Plural, PascalCase (e.g.,
-
File Organization
- Keep files in their appropriate directories
- Follow Laravel's directory structure conventions
- Module-specific code should go in the appropriate module directory
-
Unit Tests
- Write tests for new features and bug fixes
- Ensure all tests pass before submitting your PR
- Aim for a high test coverage
-
Manual Testing
- Test your changes in both light and dark modes
- Test on different screen sizes
- Verify authorization works correctly
- Fork the repository and create your branch from
main - If you've added code that should be tested, add tests
- Ensure the test suite passes
- Make sure your code follows the coding standards
- Update the documentation if necessary
- Issue the pull request
Before submitting your PR, please ensure:
- Your code follows the style guidelines of this project
- You have separated view/controller logic appropriately
- Request validation is in dedicated Request classes
- Business logic is in Service classes
- All strings are translatable
- Changes work in both light and dark modes
- UI is responsive on all screen sizes
- Authorization and permissions are properly implemented
- You've added hooks for extension points if applicable
- You've updated documentation if necessary
- You've added tests for your changes
- All tests pass
See the README.md for instructions on setting up the development environment.
By contributing, you agree that your contributions will be licensed under the project's license.
Don't hesitate to reach out if you have any questions. You can contact the maintainers at manirujjamanakash@gmail.com.
Thank you for contributing to Lara Dashboard!