# Code Style and Structure for typescript

- Use only internal component library in "foundation/resources/client/ui" folder.
- Instead of writing plain text "some text" in react, use <Trans message="some text" /> component
- Write concise, technical TypeScript code with accurate examples
- Use functional and declarative programming patterns; avoid classes
- Prefer iteration and modularization over code duplication
- Use descriptive variable names with auxiliary verbs (e.g., isLoading, hasError)
- Use <Fragment> instead of <> in react

# Code Style and Structure for datatable pages

- compose datatable from files in common/foundation/resources/client/datatable folder
- put columns and filters in the same file
- use defaults, don't override cell height or other properties
- use common/foundation/resources/client/admin/users/user-datatable.tsx file as an example

# Code Style and Structure for PHP and Laravel

- Don't use dependency injection when possible. Instead use laravel helpers like request() and facades.

# Code Style and Structure for Laravel Controllers

- Controllers extend Common\Core\BaseController
- Most controllers are for API, use Resource controllers
- Don't use raw strings when specifying classes (e.g. "App\Models\Ticket") use "Ticket::class" syntax instead.
- Name data validated by request()->validate() as $data
- show, store and update methods return in this format: $this->success(['resourceName' => $resource])
- index method returns in this format: $this->success(['pagination' => $pagination])
