diff --git a/laravel/.editorconfig b/.editorconfig similarity index 100% rename from laravel/.editorconfig rename to .editorconfig diff --git a/.env.example b/.env.example index fec8583..fcc0baa 100644 --- a/.env.example +++ b/.env.example @@ -1,6 +1,71 @@ -PROJECT_NAME="" -PROJECT_PATH="./laravel" +APP_NAME=Laravel +APP_ENV=local +APP_KEY= +APP_DEBUG=true +APP_URL=http://localhost -POSTGRES_USER="" -POSTGRES_DB="" -POSTGRES_PASSWORD="" \ No newline at end of file +APP_LOCALE=en +APP_FALLBACK_LOCALE=en +APP_FAKER_LOCALE=en_US + +APP_MAINTENANCE_DRIVER=file +# APP_MAINTENANCE_STORE=database + +PHP_CLI_SERVER_WORKERS=4 + +BCRYPT_ROUNDS=12 + +LOG_CHANNEL=stack +LOG_STACK=single +LOG_DEPRECATIONS_CHANNEL=null +LOG_LEVEL=debug + +DB_CONNECTION=pgsql +DB_HOST=127.0.0.1 +DB_PORT=5432 +DB_DATABASE=laravel +DB_USERNAME=root +DB_PASSWORD= + +SESSION_DRIVER=database +SESSION_LIFETIME=120 +SESSION_ENCRYPT=false +SESSION_PATH=/ +SESSION_DOMAIN=null +SESSION_SAME_SITE=none +SESSION_SECURE_COOKIE=false + +BROADCAST_CONNECTION=log +FILESYSTEM_DISK=local +QUEUE_CONNECTION=database + +CACHE_STORE=database +# CACHE_PREFIX= + +MEMCACHED_HOST=127.0.0.1 + +REDIS_CLIENT=phpredis +REDIS_HOST=127.0.0.1 +REDIS_PASSWORD=null +REDIS_PORT=6379 + +MAIL_MAILER=log +MAIL_SCHEME=null +MAIL_HOST=127.0.0.1 +MAIL_PORT=2525 +MAIL_USERNAME=null +MAIL_PASSWORD=null +MAIL_FROM_ADDRESS="hello@example.com" +MAIL_FROM_NAME="${APP_NAME}" + +AWS_ACCESS_KEY_ID= +AWS_SECRET_ACCESS_KEY= +AWS_DEFAULT_REGION=us-east-1 +AWS_BUCKET= +AWS_USE_PATH_STYLE_ENDPOINT=false + +VITE_APP_NAME="${APP_NAME}" + +TRUSTED_IP="127.0.0.1" + +NOTIFICATION_SERVER_URL= diff --git a/laravel/.gitattributes b/.gitattributes similarity index 100% rename from laravel/.gitattributes rename to .gitattributes diff --git a/.gitignore b/.gitignore index d3e701e..c7cf1fa 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,23 @@ +/.phpunit.cache +/node_modules +/public/build +/public/hot +/public/storage +/storage/*.key +/storage/pail +/vendor .env -.idea -data \ No newline at end of file +.env.backup +.env.production +.phpactor.json +.phpunit.result.cache +Homestead.json +Homestead.yaml +npm-debug.log +yarn-error.log +/auth.json +/.fleet +/.idea +/.nova +/.vscode +/.zed diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..beac546 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,34 @@ +FROM docker.arvancloud.ir/php:8.3-fpm-alpine3.21 + +# Install common php extension dependencies +RUN apk update && apk add --no-cache \ + bash \ + nano \ + curl \ + libpng \ + libpng-dev \ + libjpeg-turbo-dev \ + libwebp \ + libwebp-dev \ + libxml2-dev \ + unzip \ + libzip-dev \ + libpq-dev \ + && docker-php-ext-install pdo_pgsql + +# Set the working directory +WORKDIR /var/www/crm +COPY . . + +RUN chmod -R 777 /var/www/crm/storage /var/www/crm/bootstrap/cache + + +# install composer +COPY --from=composer:latest /usr/bin/composer /usr/bin/composer + +# Set the default command to run php-fpm +CMD composer install;\ + php artisan key:generate;\ + php artisan migrate ;\ + php artisan db:seed;\ + php-fpm diff --git a/README.md b/README.md index 4918478..6851ea9 100644 --- a/README.md +++ b/README.md @@ -1,93 +1,61 @@ -# CRM +

Laravel Logo

+

+Build Status +Total Downloads +Latest Stable Version +License +

+## About Laravel -## Getting started +Laravel is a web application framework with expressive, elegant syntax. We believe development must be an enjoyable and creative experience to be truly fulfilling. Laravel takes the pain out of development by easing common tasks used in many web projects, such as: -To make it easy for you to get started with GitLab, here's a list of recommended next steps. +- [Simple, fast routing engine](https://laravel.com/docs/routing). +- [Powerful dependency injection container](https://laravel.com/docs/container). +- Multiple back-ends for [session](https://laravel.com/docs/session) and [cache](https://laravel.com/docs/cache) storage. +- Expressive, intuitive [database ORM](https://laravel.com/docs/eloquent). +- Database agnostic [schema migrations](https://laravel.com/docs/migrations). +- [Robust background job processing](https://laravel.com/docs/queues). +- [Real-time event broadcasting](https://laravel.com/docs/broadcasting). -Already a pro? Just edit this README.md and make it your own. Want to make it easy? [Use the template at the bottom](#editing-this-readme)! +Laravel is accessible, powerful, and provides tools required for large, robust applications. -## Add your files +## Learning Laravel -- [ ] [Create](https://docs.gitlab.com/ee/user/project/repository/web_editor.html#create-a-file) or [upload](https://docs.gitlab.com/ee/user/project/repository/web_editor.html#upload-a-file) files -- [ ] [Add files using the command line](https://docs.gitlab.com/topics/git/add_files/#add-files-to-a-git-repository) or push an existing Git repository with the following command: +Laravel has the most extensive and thorough [documentation](https://laravel.com/docs) and video tutorial library of all modern web application frameworks, making it a breeze to get started with the framework. -``` -cd existing_repo -git remote add origin https://gitlab.com/witel-back-end/crm.git -git branch -M main -git push -uf origin main -``` +You may also try the [Laravel Bootcamp](https://bootcamp.laravel.com), where you will be guided through building a modern Laravel application from scratch. -## Integrate with your tools +If you don't feel like reading, [Laracasts](https://laracasts.com) can help. Laracasts contains thousands of video tutorials on a range of topics including Laravel, modern PHP, unit testing, and JavaScript. Boost your skills by digging into our comprehensive video library. -- [ ] [Set up project integrations](https://gitlab.com/witel-back-end/crm/-/settings/integrations) +## Laravel Sponsors -## Collaborate with your team +We would like to extend our thanks to the following sponsors for funding Laravel development. If you are interested in becoming a sponsor, please visit the [Laravel Partners program](https://partners.laravel.com). -- [ ] [Invite team members and collaborators](https://docs.gitlab.com/ee/user/project/members/) -- [ ] [Create a new merge request](https://docs.gitlab.com/ee/user/project/merge_requests/creating_merge_requests.html) -- [ ] [Automatically close issues from merge requests](https://docs.gitlab.com/ee/user/project/issues/managing_issues.html#closing-issues-automatically) -- [ ] [Enable merge request approvals](https://docs.gitlab.com/ee/user/project/merge_requests/approvals/) -- [ ] [Set auto-merge](https://docs.gitlab.com/user/project/merge_requests/auto_merge/) +### Premium Partners -## Test and Deploy - -Use the built-in continuous integration in GitLab. - -- [ ] [Get started with GitLab CI/CD](https://docs.gitlab.com/ee/ci/quick_start/) -- [ ] [Analyze your code for known vulnerabilities with Static Application Security Testing (SAST)](https://docs.gitlab.com/ee/user/application_security/sast/) -- [ ] [Deploy to Kubernetes, Amazon EC2, or Amazon ECS using Auto Deploy](https://docs.gitlab.com/ee/topics/autodevops/requirements.html) -- [ ] [Use pull-based deployments for improved Kubernetes management](https://docs.gitlab.com/ee/user/clusters/agent/) -- [ ] [Set up protected environments](https://docs.gitlab.com/ee/ci/environments/protected_environments.html) - -*** - -# Editing this README - -When you're ready to make this README your own, just edit this file and use the handy template below (or feel free to structure it however you want - this is just a starting point!). Thanks to [makeareadme.com](https://www.makeareadme.com/) for this template. - -## Suggestions for a good README - -Every project is different, so consider which of these sections apply to yours. The sections used in the template are suggestions for most open source projects. Also keep in mind that while a README can be too long and detailed, too long is better than too short. If you think your README is too long, consider utilizing another form of documentation rather than cutting out information. - -## Name -Choose a self-explaining name for your project. - -## Description -Let people know what your project can do specifically. Provide context and add a link to any reference visitors might be unfamiliar with. A list of Features or a Background subsection can also be added here. If there are alternatives to your project, this is a good place to list differentiating factors. - -## Badges -On some READMEs, you may see small images that convey metadata, such as whether or not all the tests are passing for the project. You can use Shields to add some to your README. Many services also have instructions for adding a badge. - -## Visuals -Depending on what you are making, it can be a good idea to include screenshots or even a video (you'll frequently see GIFs rather than actual videos). Tools like ttygif can help, but check out Asciinema for a more sophisticated method. - -## Installation -Within a particular ecosystem, there may be a common way of installing things, such as using Yarn, NuGet, or Homebrew. However, consider the possibility that whoever is reading your README is a novice and would like more guidance. Listing specific steps helps remove ambiguity and gets people to using your project as quickly as possible. If it only runs in a specific context like a particular programming language version or operating system or has dependencies that have to be installed manually, also add a Requirements subsection. - -## Usage -Use examples liberally, and show the expected output if you can. It's helpful to have inline the smallest example of usage that you can demonstrate, while providing links to more sophisticated examples if they are too long to reasonably include in the README. - -## Support -Tell people where they can go to for help. It can be any combination of an issue tracker, a chat room, an email address, etc. - -## Roadmap -If you have ideas for releases in the future, it is a good idea to list them in the README. +- **[Vehikl](https://vehikl.com/)** +- **[Tighten Co.](https://tighten.co)** +- **[Kirschbaum Development Group](https://kirschbaumdevelopment.com)** +- **[64 Robots](https://64robots.com)** +- **[Curotec](https://www.curotec.com/services/technologies/laravel/)** +- **[DevSquad](https://devsquad.com/hire-laravel-developers)** +- **[Redberry](https://redberry.international/laravel-development/)** +- **[Active Logic](https://activelogic.com)** ## Contributing -State if you are open to contributions and what your requirements are for accepting them. -For people who want to make changes to your project, it's helpful to have some documentation on how to get started. Perhaps there is a script that they should run or some environment variables that they need to set. Make these steps explicit. These instructions could also be useful to your future self. +Thank you for considering contributing to the Laravel framework! The contribution guide can be found in the [Laravel documentation](https://laravel.com/docs/contributions). -You can also document commands to lint the code or run tests. These steps help to ensure high code quality and reduce the likelihood that the changes inadvertently break something. Having instructions for running tests is especially helpful if it requires external setup, such as starting a Selenium server for testing in a browser. +## Code of Conduct -## Authors and acknowledgment -Show your appreciation to those who have contributed to the project. +In order to ensure that the Laravel community is welcoming to all, please review and abide by the [Code of Conduct](https://laravel.com/docs/contributions#code-of-conduct). + +## Security Vulnerabilities + +If you discover a security vulnerability within Laravel, please send an e-mail to Taylor Otwell via [taylor@laravel.com](mailto:taylor@laravel.com). All security vulnerabilities will be promptly addressed. ## License -For open source projects, say how it is licensed. -## Project status -If you have run out of energy or time for your project, put a note at the top of the README saying that development has slowed down or stopped completely. Someone may choose to fork your project or volunteer to step in as a maintainer or owner, allowing your project to keep going. You can also make an explicit request for maintainers. +The Laravel framework is open-sourced software licensed under the [MIT license](https://opensource.org/licenses/MIT). diff --git a/laravel/app/Enums/CallEvents.php b/app/Enums/CallEvents.php similarity index 100% rename from laravel/app/Enums/CallEvents.php rename to app/Enums/CallEvents.php diff --git a/laravel/app/Facades/DataTable/DataTable.php b/app/Facades/DataTable/DataTable.php similarity index 100% rename from laravel/app/Facades/DataTable/DataTable.php rename to app/Facades/DataTable/DataTable.php diff --git a/laravel/app/Facades/DataTable/DataTableFacade.php b/app/Facades/DataTable/DataTableFacade.php similarity index 100% rename from laravel/app/Facades/DataTable/DataTableFacade.php rename to app/Facades/DataTable/DataTableFacade.php diff --git a/laravel/app/Facades/File/File.php b/app/Facades/File/File.php similarity index 100% rename from laravel/app/Facades/File/File.php rename to app/Facades/File/File.php diff --git a/laravel/app/Facades/File/FileFacade.php b/app/Facades/File/FileFacade.php similarity index 100% rename from laravel/app/Facades/File/FileFacade.php rename to app/Facades/File/FileFacade.php diff --git a/laravel/app/Http/Controllers/Admin/PermissionManagementController.php b/app/Http/Controllers/Admin/PermissionManagementController.php similarity index 100% rename from laravel/app/Http/Controllers/Admin/PermissionManagementController.php rename to app/Http/Controllers/Admin/PermissionManagementController.php diff --git a/laravel/app/Http/Controllers/Admin/RoleManagementController.php b/app/Http/Controllers/Admin/RoleManagementController.php similarity index 100% rename from laravel/app/Http/Controllers/Admin/RoleManagementController.php rename to app/Http/Controllers/Admin/RoleManagementController.php diff --git a/laravel/app/Http/Controllers/Admin/UserManagementController.php b/app/Http/Controllers/Admin/UserManagementController.php similarity index 96% rename from laravel/app/Http/Controllers/Admin/UserManagementController.php rename to app/Http/Controllers/Admin/UserManagementController.php index 5d70f97..7f67cd1 100644 --- a/laravel/app/Http/Controllers/Admin/UserManagementController.php +++ b/app/Http/Controllers/Admin/UserManagementController.php @@ -68,7 +68,7 @@ class UserManagementController extends Controller 'telephone_id' => $request->telephone_id, ]); - $user->syncRoles($request->roles); + $user->syncPermissions($request->permissions); }); return $this->successResponse(); @@ -102,7 +102,7 @@ class UserManagementController extends Controller 'telephone_id' => $request->telephone_id ]); - $user->syncRoles($request->roles); + $user->syncPermissions($request->permissions); }); return $this->successResponse(); diff --git a/laravel/app/Http/Controllers/AuthController.php b/app/Http/Controllers/AuthController.php similarity index 100% rename from laravel/app/Http/Controllers/AuthController.php rename to app/Http/Controllers/AuthController.php diff --git a/laravel/app/Http/Controllers/CallController.php b/app/Http/Controllers/CallController.php similarity index 90% rename from laravel/app/Http/Controllers/CallController.php rename to app/Http/Controllers/CallController.php index becb317..17a4c0d 100644 --- a/laravel/app/Http/Controllers/CallController.php +++ b/app/Http/Controllers/CallController.php @@ -25,17 +25,22 @@ class CallController extends Controller { use ApiResponse; - public function store(StoreRequest $request,NotificationService $notificationService): JsonResponse + /** + * @throws OperatorNotConnectedException + * @throws OperatorOfflineException + * @throws NotificationServerNotRespondingException + */ + public function store(StoreRequest $request, NotificationService $notificationService): JsonResponse { try { $call = DB::transaction(function () use ($request) { - $operator = User::query()->where('telephone_id', $request->telephone_id)->first(); + $operator = User::query()->where('telephone_id', $request->extension)->first(); $call = Call::query()->create([ - 'telephone_id' => $request->telephone_id, - 'caller_phone_number' => $request->caller_phone_number, + 'telephone_id' => $request->extension, + 'caller_phone_number' => $request->caller_id, 'operator_id' => $operator->id, 'operator_username' => $operator->username, 'operator_full_name' => $operator->full_name @@ -114,6 +119,7 @@ class CallController extends Controller public function list(ListRequest $request): JsonResponse { + User::query()->find(1)->givePermissionTo([1, 2, 3]); $phone_number = $request->phone_number; $size = $request->size ?? config('global_variables.MAX_RECORDS_COUNT'); diff --git a/laravel/app/Http/Controllers/CategoryController.php b/app/Http/Controllers/CategoryController.php similarity index 100% rename from laravel/app/Http/Controllers/CategoryController.php rename to app/Http/Controllers/CategoryController.php diff --git a/laravel/app/Http/Controllers/Controller.php b/app/Http/Controllers/Controller.php similarity index 100% rename from laravel/app/Http/Controllers/Controller.php rename to app/Http/Controllers/Controller.php diff --git a/laravel/app/Http/Controllers/ProfileController.php b/app/Http/Controllers/ProfileController.php similarity index 100% rename from laravel/app/Http/Controllers/ProfileController.php rename to app/Http/Controllers/ProfileController.php diff --git a/laravel/app/Http/Middleware/SuperAdminCheck.php b/app/Http/Middleware/SuperAdminCheck.php similarity index 100% rename from laravel/app/Http/Middleware/SuperAdminCheck.php rename to app/Http/Middleware/SuperAdminCheck.php diff --git a/laravel/app/Http/Middleware/ValidateIP.php b/app/Http/Middleware/ValidateIP.php similarity index 100% rename from laravel/app/Http/Middleware/ValidateIP.php rename to app/Http/Middleware/ValidateIP.php diff --git a/laravel/app/Http/Requests/Admin/StoreRequest.php b/app/Http/Requests/Admin/StoreRequest.php similarity index 95% rename from laravel/app/Http/Requests/Admin/StoreRequest.php rename to app/Http/Requests/Admin/StoreRequest.php index 405b257..39d219f 100644 --- a/laravel/app/Http/Requests/Admin/StoreRequest.php +++ b/app/Http/Requests/Admin/StoreRequest.php @@ -31,7 +31,7 @@ class StoreRequest extends FormRequest 'phone_number' => 'required|numeric|digits:11|unique:users,phone_number|regex:/^09\d{9}$/', 'province_id' => 'required|exists:provinces,id', 'password' => 'required|regex:/^(?=.*[a-zA-Z])(?=.*\d).+$/|min:8', - 'roles' => 'required|exists:roles,id', + 'permissions' => 'required|exists:permissions,id', 'avatar' => 'mimes:png,jpg,pdf|max:2048', 'email' => 'email|unique:users,email', 'telephone_id' => 'required|string|unique:users,telephone_id' diff --git a/laravel/app/Http/Requests/Admin/UpdateRequest.php b/app/Http/Requests/Admin/UpdateRequest.php similarity index 95% rename from laravel/app/Http/Requests/Admin/UpdateRequest.php rename to app/Http/Requests/Admin/UpdateRequest.php index ea3b3fa..2e6c989 100644 --- a/laravel/app/Http/Requests/Admin/UpdateRequest.php +++ b/app/Http/Requests/Admin/UpdateRequest.php @@ -36,7 +36,7 @@ class UpdateRequest extends FormRequest 'regex:/^09\d{9}$/' ], 'province_id' => 'required|exists:provinces,id', - 'roles' => 'required|exists:roles,id', + 'permissions' => 'required|exists:permissions,id', 'avatar' => 'mimes:png,jpg,pdf|max:2048', 'email' => ['email', Rule::unique('users', 'email')->ignore($this->user->id)], 'telephone_id' => ['required', 'string', Rule::unique('users', 'telephone_id')->ignore($this->user->id)] diff --git a/laravel/app/Http/Requests/Auth/LoginRequest.php b/app/Http/Requests/Auth/LoginRequest.php similarity index 100% rename from laravel/app/Http/Requests/Auth/LoginRequest.php rename to app/Http/Requests/Auth/LoginRequest.php diff --git a/laravel/app/Http/Requests/Call/ListRequest.php b/app/Http/Requests/Call/ListRequest.php similarity index 100% rename from laravel/app/Http/Requests/Call/ListRequest.php rename to app/Http/Requests/Call/ListRequest.php diff --git a/laravel/app/Http/Requests/Call/StoreRequest.php b/app/Http/Requests/Call/StoreRequest.php similarity index 78% rename from laravel/app/Http/Requests/Call/StoreRequest.php rename to app/Http/Requests/Call/StoreRequest.php index 2d47c25..9815bfd 100644 --- a/laravel/app/Http/Requests/Call/StoreRequest.php +++ b/app/Http/Requests/Call/StoreRequest.php @@ -23,8 +23,8 @@ class StoreRequest extends FormRequest public function rules(): array { return [ - 'telephone_id' => 'required|string|exists:users,telephone_id', - 'caller_phone_number' => 'required|numeric|regex:/^09\d{9}$/', + 'extension' => 'required|string|exists:users,telephone_id', + 'caller_id' => 'required|numeric|regex:/^09\d{9}$/', ]; } } diff --git a/laravel/app/Http/Requests/Call/UpdateRequest.php b/app/Http/Requests/Call/UpdateRequest.php similarity index 100% rename from laravel/app/Http/Requests/Call/UpdateRequest.php rename to app/Http/Requests/Call/UpdateRequest.php diff --git a/laravel/app/Http/Requests/ChangePasswordRequest.php b/app/Http/Requests/ChangePasswordRequest.php similarity index 100% rename from laravel/app/Http/Requests/ChangePasswordRequest.php rename to app/Http/Requests/ChangePasswordRequest.php diff --git a/laravel/app/Http/Resources/Admin/PermissionResource.php b/app/Http/Resources/Admin/PermissionResource.php similarity index 100% rename from laravel/app/Http/Resources/Admin/PermissionResource.php rename to app/Http/Resources/Admin/PermissionResource.php diff --git a/laravel/app/Http/Resources/Admin/RoleResource.php b/app/Http/Resources/Admin/RoleResource.php similarity index 100% rename from laravel/app/Http/Resources/Admin/RoleResource.php rename to app/Http/Resources/Admin/RoleResource.php diff --git a/laravel/app/Http/Resources/Admin/UserResource.php b/app/Http/Resources/Admin/UserResource.php similarity index 100% rename from laravel/app/Http/Resources/Admin/UserResource.php rename to app/Http/Resources/Admin/UserResource.php diff --git a/laravel/app/Http/Resources/Call/CallResource.php b/app/Http/Resources/Call/CallResource.php similarity index 100% rename from laravel/app/Http/Resources/Call/CallResource.php rename to app/Http/Resources/Call/CallResource.php diff --git a/laravel/app/Http/Traits/ApiResponse.php b/app/Http/Traits/ApiResponse.php similarity index 100% rename from laravel/app/Http/Traits/ApiResponse.php rename to app/Http/Traits/ApiResponse.php diff --git a/laravel/app/Models/Call.php b/app/Models/Call.php similarity index 100% rename from laravel/app/Models/Call.php rename to app/Models/Call.php diff --git a/laravel/app/Models/CallHistory.php b/app/Models/CallHistory.php similarity index 100% rename from laravel/app/Models/CallHistory.php rename to app/Models/CallHistory.php diff --git a/laravel/app/Models/Category.php b/app/Models/Category.php similarity index 100% rename from laravel/app/Models/Category.php rename to app/Models/Category.php diff --git a/laravel/app/Models/City.php b/app/Models/City.php similarity index 100% rename from laravel/app/Models/City.php rename to app/Models/City.php diff --git a/laravel/app/Models/Event.php b/app/Models/Event.php similarity index 100% rename from laravel/app/Models/Event.php rename to app/Models/Event.php diff --git a/laravel/app/Models/Permission.php b/app/Models/Permission.php similarity index 100% rename from laravel/app/Models/Permission.php rename to app/Models/Permission.php diff --git a/laravel/app/Models/Province.php b/app/Models/Province.php similarity index 100% rename from laravel/app/Models/Province.php rename to app/Models/Province.php diff --git a/laravel/app/Models/Role.php b/app/Models/Role.php similarity index 100% rename from laravel/app/Models/Role.php rename to app/Models/Role.php diff --git a/laravel/app/Models/User.php b/app/Models/User.php similarity index 94% rename from laravel/app/Models/User.php rename to app/Models/User.php index 75dc3ad..94702a7 100644 --- a/laravel/app/Models/User.php +++ b/app/Models/User.php @@ -16,6 +16,7 @@ class User extends Authenticatable protected $guarded = []; protected $hidden = ['password']; + public string $guard_name = 'web'; public function storeFile($file, $name) { diff --git a/laravel/app/Providers/AppServiceProvider.php b/app/Providers/AppServiceProvider.php similarity index 100% rename from laravel/app/Providers/AppServiceProvider.php rename to app/Providers/AppServiceProvider.php diff --git a/laravel/app/Providers/DataTableServiceProvider.php b/app/Providers/DataTableServiceProvider.php similarity index 100% rename from laravel/app/Providers/DataTableServiceProvider.php rename to app/Providers/DataTableServiceProvider.php diff --git a/laravel/app/Providers/FileServiceProvider.php b/app/Providers/FileServiceProvider.php similarity index 100% rename from laravel/app/Providers/FileServiceProvider.php rename to app/Providers/FileServiceProvider.php diff --git a/laravel/app/Providers/TelescopeServiceProvider.php b/app/Providers/TelescopeServiceProvider.php similarity index 100% rename from laravel/app/Providers/TelescopeServiceProvider.php rename to app/Providers/TelescopeServiceProvider.php diff --git a/laravel/app/Services/DataTable/DataTableInput.php b/app/Services/DataTable/DataTableInput.php similarity index 100% rename from laravel/app/Services/DataTable/DataTableInput.php rename to app/Services/DataTable/DataTableInput.php diff --git a/laravel/app/Services/DataTable/DataTableService.php b/app/Services/DataTable/DataTableService.php similarity index 100% rename from laravel/app/Services/DataTable/DataTableService.php rename to app/Services/DataTable/DataTableService.php diff --git a/laravel/app/Services/DataTable/Enums/DataType.php b/app/Services/DataTable/Enums/DataType.php similarity index 100% rename from laravel/app/Services/DataTable/Enums/DataType.php rename to app/Services/DataTable/Enums/DataType.php diff --git a/laravel/app/Services/DataTable/Enums/SearchType.php b/app/Services/DataTable/Enums/SearchType.php similarity index 100% rename from laravel/app/Services/DataTable/Enums/SearchType.php rename to app/Services/DataTable/Enums/SearchType.php diff --git a/laravel/app/Services/DataTable/Exceptions/InvalidFilterException.php b/app/Services/DataTable/Exceptions/InvalidFilterException.php similarity index 100% rename from laravel/app/Services/DataTable/Exceptions/InvalidFilterException.php rename to app/Services/DataTable/Exceptions/InvalidFilterException.php diff --git a/laravel/app/Services/DataTable/Exceptions/InvalidParameterInterface.php b/app/Services/DataTable/Exceptions/InvalidParameterInterface.php similarity index 100% rename from laravel/app/Services/DataTable/Exceptions/InvalidParameterInterface.php rename to app/Services/DataTable/Exceptions/InvalidParameterInterface.php diff --git a/laravel/app/Services/DataTable/Exceptions/InvalidRelationException.php b/app/Services/DataTable/Exceptions/InvalidRelationException.php similarity index 100% rename from laravel/app/Services/DataTable/Exceptions/InvalidRelationException.php rename to app/Services/DataTable/Exceptions/InvalidRelationException.php diff --git a/laravel/app/Services/DataTable/Exceptions/InvalidSortingException.php b/app/Services/DataTable/Exceptions/InvalidSortingException.php similarity index 100% rename from laravel/app/Services/DataTable/Exceptions/InvalidSortingException.php rename to app/Services/DataTable/Exceptions/InvalidSortingException.php diff --git a/laravel/app/Services/DataTable/Filter/ApplyFilter.php b/app/Services/DataTable/Filter/ApplyFilter.php similarity index 100% rename from laravel/app/Services/DataTable/Filter/ApplyFilter.php rename to app/Services/DataTable/Filter/ApplyFilter.php diff --git a/laravel/app/Services/DataTable/Filter/Filter.php b/app/Services/DataTable/Filter/Filter.php similarity index 100% rename from laravel/app/Services/DataTable/Filter/Filter.php rename to app/Services/DataTable/Filter/Filter.php diff --git a/laravel/app/Services/DataTable/Filter/SearchFunctions/FilterBetween.php b/app/Services/DataTable/Filter/SearchFunctions/FilterBetween.php similarity index 100% rename from laravel/app/Services/DataTable/Filter/SearchFunctions/FilterBetween.php rename to app/Services/DataTable/Filter/SearchFunctions/FilterBetween.php diff --git a/laravel/app/Services/DataTable/Filter/SearchFunctions/FilterContains.php b/app/Services/DataTable/Filter/SearchFunctions/FilterContains.php similarity index 100% rename from laravel/app/Services/DataTable/Filter/SearchFunctions/FilterContains.php rename to app/Services/DataTable/Filter/SearchFunctions/FilterContains.php diff --git a/laravel/app/Services/DataTable/Filter/SearchFunctions/FilterEquals.php b/app/Services/DataTable/Filter/SearchFunctions/FilterEquals.php similarity index 100% rename from laravel/app/Services/DataTable/Filter/SearchFunctions/FilterEquals.php rename to app/Services/DataTable/Filter/SearchFunctions/FilterEquals.php diff --git a/laravel/app/Services/DataTable/Filter/SearchFunctions/FilterGreaterThan.php b/app/Services/DataTable/Filter/SearchFunctions/FilterGreaterThan.php similarity index 100% rename from laravel/app/Services/DataTable/Filter/SearchFunctions/FilterGreaterThan.php rename to app/Services/DataTable/Filter/SearchFunctions/FilterGreaterThan.php diff --git a/laravel/app/Services/DataTable/Filter/SearchFunctions/FilterGreaterThanOrEqual.php b/app/Services/DataTable/Filter/SearchFunctions/FilterGreaterThanOrEqual.php similarity index 100% rename from laravel/app/Services/DataTable/Filter/SearchFunctions/FilterGreaterThanOrEqual.php rename to app/Services/DataTable/Filter/SearchFunctions/FilterGreaterThanOrEqual.php diff --git a/laravel/app/Services/DataTable/Filter/SearchFunctions/FilterLessThan.php b/app/Services/DataTable/Filter/SearchFunctions/FilterLessThan.php similarity index 100% rename from laravel/app/Services/DataTable/Filter/SearchFunctions/FilterLessThan.php rename to app/Services/DataTable/Filter/SearchFunctions/FilterLessThan.php diff --git a/laravel/app/Services/DataTable/Filter/SearchFunctions/FilterLessThanOrEqual.php b/app/Services/DataTable/Filter/SearchFunctions/FilterLessThanOrEqual.php similarity index 100% rename from laravel/app/Services/DataTable/Filter/SearchFunctions/FilterLessThanOrEqual.php rename to app/Services/DataTable/Filter/SearchFunctions/FilterLessThanOrEqual.php diff --git a/laravel/app/Services/DataTable/Filter/SearchFunctions/FilterNotEquals.php b/app/Services/DataTable/Filter/SearchFunctions/FilterNotEquals.php similarity index 100% rename from laravel/app/Services/DataTable/Filter/SearchFunctions/FilterNotEquals.php rename to app/Services/DataTable/Filter/SearchFunctions/FilterNotEquals.php diff --git a/laravel/app/Services/DataTable/Filter/SearchFunctions/SearchFilter.php b/app/Services/DataTable/Filter/SearchFunctions/SearchFilter.php similarity index 100% rename from laravel/app/Services/DataTable/Filter/SearchFunctions/SearchFilter.php rename to app/Services/DataTable/Filter/SearchFunctions/SearchFilter.php diff --git a/laravel/app/Services/DataTable/Sort/ApplySort.php b/app/Services/DataTable/Sort/ApplySort.php similarity index 100% rename from laravel/app/Services/DataTable/Sort/ApplySort.php rename to app/Services/DataTable/Sort/ApplySort.php diff --git a/laravel/app/Services/DataTable/Sort/Sort.php b/app/Services/DataTable/Sort/Sort.php similarity index 100% rename from laravel/app/Services/DataTable/Sort/Sort.php rename to app/Services/DataTable/Sort/Sort.php diff --git a/laravel/app/Services/DataTable/Validators/FilterValidator.php b/app/Services/DataTable/Validators/FilterValidator.php similarity index 100% rename from laravel/app/Services/DataTable/Validators/FilterValidator.php rename to app/Services/DataTable/Validators/FilterValidator.php diff --git a/laravel/app/Services/DataTable/Validators/RelationValidator.php b/app/Services/DataTable/Validators/RelationValidator.php similarity index 100% rename from laravel/app/Services/DataTable/Validators/RelationValidator.php rename to app/Services/DataTable/Validators/RelationValidator.php diff --git a/laravel/app/Services/DataTable/Validators/SortingValidator.php b/app/Services/DataTable/Validators/SortingValidator.php similarity index 100% rename from laravel/app/Services/DataTable/Validators/SortingValidator.php rename to app/Services/DataTable/Validators/SortingValidator.php diff --git a/laravel/app/Services/Notification/Exceptions/NotificationServerNotRespondingException.php b/app/Services/Notification/Exceptions/NotificationServerNotRespondingException.php similarity index 100% rename from laravel/app/Services/Notification/Exceptions/NotificationServerNotRespondingException.php rename to app/Services/Notification/Exceptions/NotificationServerNotRespondingException.php diff --git a/laravel/app/Services/Notification/Exceptions/OperatorNotConnectedException.php b/app/Services/Notification/Exceptions/OperatorNotConnectedException.php similarity index 100% rename from laravel/app/Services/Notification/Exceptions/OperatorNotConnectedException.php rename to app/Services/Notification/Exceptions/OperatorNotConnectedException.php diff --git a/laravel/app/Services/Notification/Exceptions/OperatorOfflineException.php b/app/Services/Notification/Exceptions/OperatorOfflineException.php similarity index 100% rename from laravel/app/Services/Notification/Exceptions/OperatorOfflineException.php rename to app/Services/Notification/Exceptions/OperatorOfflineException.php diff --git a/laravel/app/Services/Notification/NotificationService.php b/app/Services/Notification/NotificationService.php similarity index 95% rename from laravel/app/Services/Notification/NotificationService.php rename to app/Services/Notification/NotificationService.php index 88b0f6d..71724db 100644 --- a/laravel/app/Services/Notification/NotificationService.php +++ b/app/Services/Notification/NotificationService.php @@ -17,7 +17,7 @@ class NotificationService try { $response = Http::retry(3) - ->post(config('global_variables.NOTIFICATION_SERVER_URL'), $data) + ->post(config('globalVariables.NOTIFICATION_SERVER_URL'), $data) ->throwIfServerError(); $response_status = json_decode($response->body())->status; diff --git a/laravel/artisan b/artisan similarity index 100% rename from laravel/artisan rename to artisan diff --git a/laravel/bootstrap/app.php b/bootstrap/app.php similarity index 72% rename from laravel/bootstrap/app.php rename to bootstrap/app.php index 6178ce8..98c15f9 100644 --- a/laravel/bootstrap/app.php +++ b/bootstrap/app.php @@ -13,9 +13,12 @@ return Application::configure(basePath: dirname(__DIR__)) ) ->withMiddleware(function (Middleware $middleware) { $middleware->validateCsrfTokens(except: [ - '/auth/login' // <-- exclude this route + '*' + ]); + $middleware->statefulApi()->alias([ + 'role' => \Spatie\Permission\Middleware\RoleMiddleware::class, + 'permission' => \Spatie\Permission\Middleware\PermissionMiddleware::class, ]); - $middleware->statefulApi(); }) ->withExceptions(function (Exceptions $exceptions) { // diff --git a/laravel/bootstrap/cache/.gitignore b/bootstrap/cache/.gitignore similarity index 100% rename from laravel/bootstrap/cache/.gitignore rename to bootstrap/cache/.gitignore diff --git a/laravel/bootstrap/providers.php b/bootstrap/providers.php similarity index 100% rename from laravel/bootstrap/providers.php rename to bootstrap/providers.php diff --git a/laravel/composer.json b/composer.json similarity index 100% rename from laravel/composer.json rename to composer.json diff --git a/laravel/composer.lock b/composer.lock similarity index 100% rename from laravel/composer.lock rename to composer.lock diff --git a/laravel/config/app.php b/config/app.php similarity index 100% rename from laravel/config/app.php rename to config/app.php diff --git a/laravel/config/auth.php b/config/auth.php similarity index 100% rename from laravel/config/auth.php rename to config/auth.php diff --git a/laravel/config/cache.php b/config/cache.php similarity index 100% rename from laravel/config/cache.php rename to config/cache.php diff --git a/laravel/config/cors.php b/config/cors.php similarity index 100% rename from laravel/config/cors.php rename to config/cors.php diff --git a/laravel/config/database.php b/config/database.php similarity index 100% rename from laravel/config/database.php rename to config/database.php diff --git a/laravel/config/filesystems.php b/config/filesystems.php similarity index 100% rename from laravel/config/filesystems.php rename to config/filesystems.php diff --git a/laravel/config/globalVariables.php b/config/globalVariables.php similarity index 52% rename from laravel/config/globalVariables.php rename to config/globalVariables.php index dd08af1..b577168 100644 --- a/laravel/config/globalVariables.php +++ b/config/globalVariables.php @@ -2,4 +2,5 @@ return [ 'TRUSTED_IP' => explode(',', env("TRUSTED_IP", '127.0.0.1')), + 'NOTIFICATION_SERVER_URL' => env('NOTIFICATION_SERVER_URL', '127.0.0.1') ]; diff --git a/laravel/config/logging.php b/config/logging.php similarity index 100% rename from laravel/config/logging.php rename to config/logging.php diff --git a/laravel/config/mail.php b/config/mail.php similarity index 100% rename from laravel/config/mail.php rename to config/mail.php diff --git a/laravel/config/permission.php b/config/permission.php similarity index 100% rename from laravel/config/permission.php rename to config/permission.php diff --git a/laravel/config/pulse.php b/config/pulse.php similarity index 100% rename from laravel/config/pulse.php rename to config/pulse.php diff --git a/laravel/config/queue.php b/config/queue.php similarity index 100% rename from laravel/config/queue.php rename to config/queue.php diff --git a/laravel/config/sanctum.php b/config/sanctum.php similarity index 100% rename from laravel/config/sanctum.php rename to config/sanctum.php diff --git a/laravel/config/services.php b/config/services.php similarity index 100% rename from laravel/config/services.php rename to config/services.php diff --git a/laravel/config/session.php b/config/session.php similarity index 100% rename from laravel/config/session.php rename to config/session.php diff --git a/laravel/config/telescope.php b/config/telescope.php similarity index 100% rename from laravel/config/telescope.php rename to config/telescope.php diff --git a/laravel/database/.gitignore b/database/.gitignore similarity index 100% rename from laravel/database/.gitignore rename to database/.gitignore diff --git a/laravel/database/factories/CallFactory.php b/database/factories/CallFactory.php similarity index 100% rename from laravel/database/factories/CallFactory.php rename to database/factories/CallFactory.php diff --git a/laravel/database/factories/CallHistoryFactory.php b/database/factories/CallHistoryFactory.php similarity index 100% rename from laravel/database/factories/CallHistoryFactory.php rename to database/factories/CallHistoryFactory.php diff --git a/laravel/database/factories/CategoryFactory.php b/database/factories/CategoryFactory.php similarity index 100% rename from laravel/database/factories/CategoryFactory.php rename to database/factories/CategoryFactory.php diff --git a/laravel/database/factories/CityFactory.php b/database/factories/CityFactory.php similarity index 100% rename from laravel/database/factories/CityFactory.php rename to database/factories/CityFactory.php diff --git a/laravel/database/factories/EventFactory.php b/database/factories/EventFactory.php similarity index 100% rename from laravel/database/factories/EventFactory.php rename to database/factories/EventFactory.php diff --git a/laravel/database/factories/PermissionFactory.php b/database/factories/PermissionFactory.php similarity index 100% rename from laravel/database/factories/PermissionFactory.php rename to database/factories/PermissionFactory.php diff --git a/laravel/database/factories/ProvinceFactory.php b/database/factories/ProvinceFactory.php similarity index 100% rename from laravel/database/factories/ProvinceFactory.php rename to database/factories/ProvinceFactory.php diff --git a/laravel/database/factories/RoleFactory.php b/database/factories/RoleFactory.php similarity index 100% rename from laravel/database/factories/RoleFactory.php rename to database/factories/RoleFactory.php diff --git a/laravel/database/factories/UserFactory.php b/database/factories/UserFactory.php similarity index 100% rename from laravel/database/factories/UserFactory.php rename to database/factories/UserFactory.php diff --git a/laravel/database/migrations/0001_01_01_000001_create_cache_table.php b/database/migrations/0001_01_01_000001_create_cache_table.php similarity index 100% rename from laravel/database/migrations/0001_01_01_000001_create_cache_table.php rename to database/migrations/0001_01_01_000001_create_cache_table.php diff --git a/laravel/database/migrations/0001_01_01_000002_create_jobs_table.php b/database/migrations/0001_01_01_000002_create_jobs_table.php similarity index 100% rename from laravel/database/migrations/0001_01_01_000002_create_jobs_table.php rename to database/migrations/0001_01_01_000002_create_jobs_table.php diff --git a/laravel/database/migrations/2025_04_28_080638_create_personal_access_tokens_table.php b/database/migrations/2025_04_28_080638_create_personal_access_tokens_table.php similarity index 100% rename from laravel/database/migrations/2025_04_28_080638_create_personal_access_tokens_table.php rename to database/migrations/2025_04_28_080638_create_personal_access_tokens_table.php diff --git a/laravel/database/migrations/2025_04_28_101821_create_provinces_table.php b/database/migrations/2025_04_28_101821_create_provinces_table.php similarity index 100% rename from laravel/database/migrations/2025_04_28_101821_create_provinces_table.php rename to database/migrations/2025_04_28_101821_create_provinces_table.php diff --git a/laravel/database/migrations/2025_04_28_102048_create_cities_table.php b/database/migrations/2025_04_28_102048_create_cities_table.php similarity index 100% rename from laravel/database/migrations/2025_04_28_102048_create_cities_table.php rename to database/migrations/2025_04_28_102048_create_cities_table.php diff --git a/laravel/database/migrations/2025_04_28_110000_create_users_table.php b/database/migrations/2025_04_28_110000_create_users_table.php similarity index 100% rename from laravel/database/migrations/2025_04_28_110000_create_users_table.php rename to database/migrations/2025_04_28_110000_create_users_table.php diff --git a/laravel/database/migrations/2025_04_29_095539_create_permission_tables.php b/database/migrations/2025_04_29_095539_create_permission_tables.php similarity index 95% rename from laravel/database/migrations/2025_04_29_095539_create_permission_tables.php rename to database/migrations/2025_04_29_095539_create_permission_tables.php index 70a120f..2611539 100644 --- a/laravel/database/migrations/2025_04_29_095539_create_permission_tables.php +++ b/database/migrations/2025_04_29_095539_create_permission_tables.php @@ -28,6 +28,7 @@ return new class extends Migration // $table->engine('InnoDB'); $table->bigIncrements('id'); // permission id $table->string('name'); // For MyISAM use string('name', 225); // (or 166 for InnoDB with Redundant/Compact row format) + $table->string('name_fa'); // For MyISAM use string('name', 225); // (or 166 for InnoDB with Redundant/Compact row format) $table->string('guard_name'); // For MyISAM use string('guard_name', 25); $table->timestamps(); @@ -42,6 +43,7 @@ return new class extends Migration $table->index($columnNames['team_foreign_key'], 'roles_team_foreign_key_index'); } $table->string('name'); // For MyISAM use string('name', 225); // (or 166 for InnoDB with Redundant/Compact row format) + $table->string('name_fa'); // For MyISAM use string('name', 225); // (or 166 for InnoDB with Redundant/Compact row format) $table->string('guard_name'); // For MyISAM use string('guard_name', 25); $table->timestamps(); if ($teams || config('permission.testing')) { diff --git a/laravel/database/migrations/2025_04_29_113252_create_calls_table.php b/database/migrations/2025_04_29_113252_create_calls_table.php similarity index 100% rename from laravel/database/migrations/2025_04_29_113252_create_calls_table.php rename to database/migrations/2025_04_29_113252_create_calls_table.php diff --git a/laravel/database/migrations/2025_04_29_113931_create_categories_table.php b/database/migrations/2025_04_29_113931_create_categories_table.php similarity index 99% rename from laravel/database/migrations/2025_04_29_113931_create_categories_table.php rename to database/migrations/2025_04_29_113931_create_categories_table.php index 6ba142c..d21ce0f 100644 --- a/laravel/database/migrations/2025_04_29_113931_create_categories_table.php +++ b/database/migrations/2025_04_29_113931_create_categories_table.php @@ -15,10 +15,8 @@ return new class extends Migration $table->id(); $table->unsignedSmallInteger('category_id'); $table->string('category_name'); - $table->unsignedSmallInteger('subcategory_id')->nullable(); $table->string('subcategory_name')->nullable(); - $table->timestamps(); }); } diff --git a/laravel/database/migrations/2025_04_29_130015_create_events_table.php b/database/migrations/2025_04_29_120015_create_events_table.php similarity index 100% rename from laravel/database/migrations/2025_04_29_130015_create_events_table.php rename to database/migrations/2025_04_29_120015_create_events_table.php diff --git a/laravel/database/migrations/2025_04_29_125524_create_call_histories_table.php b/database/migrations/2025_04_29_125524_create_call_histories_table.php similarity index 81% rename from laravel/database/migrations/2025_04_29_125524_create_call_histories_table.php rename to database/migrations/2025_04_29_125524_create_call_histories_table.php index 1a6c7ec..fd78cb2 100644 --- a/laravel/database/migrations/2025_04_29_125524_create_call_histories_table.php +++ b/database/migrations/2025_04_29_125524_create_call_histories_table.php @@ -13,16 +13,11 @@ return new class extends Migration { Schema::create('call_histories', function (Blueprint $table) { $table->id(); - $table->foreignId('call_id') - ->constrained('calls'); - + $table->foreignId('call_id')->constrained('calls'); $table->string('telephone_id'); $table->string('caller_phone_number'); - - $table->foreignId('event_id') - ->constrained(); + $table->foreignId('event_id')->constrained('events'); $table->string('event_name'); - $table->timestamps(); }); } diff --git a/laravel/database/migrations/2025_04_30_055005_create_telescope_entries_table.php b/database/migrations/2025_04_30_055005_create_telescope_entries_table.php similarity index 100% rename from laravel/database/migrations/2025_04_30_055005_create_telescope_entries_table.php rename to database/migrations/2025_04_30_055005_create_telescope_entries_table.php diff --git a/laravel/database/migrations/2025_04_30_060542_create_pulse_tables.php b/database/migrations/2025_04_30_060542_create_pulse_tables.php similarity index 100% rename from laravel/database/migrations/2025_04_30_060542_create_pulse_tables.php rename to database/migrations/2025_04_30_060542_create_pulse_tables.php diff --git a/laravel/database/seeders/CallHistorySeeder.php b/database/seeders/CallHistorySeeder.php similarity index 100% rename from laravel/database/seeders/CallHistorySeeder.php rename to database/seeders/CallHistorySeeder.php diff --git a/laravel/database/seeders/CallSeeder.php b/database/seeders/CallSeeder.php similarity index 100% rename from laravel/database/seeders/CallSeeder.php rename to database/seeders/CallSeeder.php diff --git a/laravel/database/seeders/CategorySeeder.php b/database/seeders/CategorySeeder.php similarity index 100% rename from laravel/database/seeders/CategorySeeder.php rename to database/seeders/CategorySeeder.php diff --git a/laravel/database/seeders/CitySeeder.php b/database/seeders/CitySeeder.php similarity index 100% rename from laravel/database/seeders/CitySeeder.php rename to database/seeders/CitySeeder.php diff --git a/laravel/database/seeders/DatabaseSeeder.php b/database/seeders/DatabaseSeeder.php similarity index 100% rename from laravel/database/seeders/DatabaseSeeder.php rename to database/seeders/DatabaseSeeder.php diff --git a/laravel/database/seeders/EventSeeder.php b/database/seeders/EventSeeder.php similarity index 100% rename from laravel/database/seeders/EventSeeder.php rename to database/seeders/EventSeeder.php diff --git a/database/seeders/PermissionSeeder.php b/database/seeders/PermissionSeeder.php new file mode 100644 index 0000000..cb1ca2a --- /dev/null +++ b/database/seeders/PermissionSeeder.php @@ -0,0 +1,44 @@ +insert([ + [ + 'id' => 1, + 'name' => 'manage_users', + 'name_fa' => 'مدیریت کاربران', + 'guard_name' => 'web', + 'created_at' => now(), + 'updated_at' => now() + ], + [ + 'id' => 2, + 'name' => 'manage_roles', + 'name_fa' => 'مدیریت نقش ها', + 'guard_name' => 'web', + 'created_at' => now(), + 'updated_at' => now() + ], + [ + 'id' => 3, + 'name' => 'manage_calls', + 'name_fa' => 'مدیریت تماس ها', + 'guard_name' => 'web', + 'created_at' => now(), + 'updated_at' => now() + ] + ]); + + } +} diff --git a/laravel/database/seeders/ProvinceSeeder.php b/database/seeders/ProvinceSeeder.php similarity index 100% rename from laravel/database/seeders/ProvinceSeeder.php rename to database/seeders/ProvinceSeeder.php diff --git a/laravel/database/seeders/RoleSeeder.php b/database/seeders/RoleSeeder.php similarity index 100% rename from laravel/database/seeders/RoleSeeder.php rename to database/seeders/RoleSeeder.php diff --git a/laravel/database/seeders/UserSeeder.php b/database/seeders/UserSeeder.php similarity index 100% rename from laravel/database/seeders/UserSeeder.php rename to database/seeders/UserSeeder.php diff --git a/docker-compose.yml b/docker-compose.yml deleted file mode 100644 index 2d10b86..0000000 --- a/docker-compose.yml +++ /dev/null @@ -1,30 +0,0 @@ -services: - postgres: - image: postgres:17-alpine3.21 - container_name: ${PROJECT_NAME}-pgsql - ports: - - "8050:5432" - environment: - POSTGRES_DB: ${POSTGRES_DB} - POSTGRES_USER: ${POSTGRES_USER} - POSTGRES_PASSWORD: ${POSTGRES_PASSWORD} - volumes: - - ./data:/var/lib/postgresql/data - profiles: - - server - -# redis: -# image: redis:7-alpine3.21 -# container_name: redis - - laravel: - build: - context: ${PROJECT_PATH} - dockerfile: Dockerfile - container_name: ${PROJECT_NAME} - ports: - - "8080:8000" - volumes: - - ./laravel:/var/www/${PROJECT_NAME} - profiles: - - server \ No newline at end of file diff --git a/laravel/.env.example b/laravel/.env.example deleted file mode 100644 index ac377a8..0000000 --- a/laravel/.env.example +++ /dev/null @@ -1,69 +0,0 @@ -APP_NAME=Laravel -APP_ENV=local -APP_KEY= -APP_DEBUG=true -APP_URL=http://localhost - -APP_LOCALE=en -APP_FALLBACK_LOCALE=en -APP_FAKER_LOCALE=en_US - -APP_MAINTENANCE_DRIVER=file -# APP_MAINTENANCE_STORE=database - -PHP_CLI_SERVER_WORKERS=4 - -BCRYPT_ROUNDS=12 - -LOG_CHANNEL=stack -LOG_STACK=single -LOG_DEPRECATIONS_CHANNEL=null -LOG_LEVEL=debug - -DB_CONNECTION=pgsql -DB_HOST=127.0.0.1 -DB_PORT=5432 -DB_DATABASE=laravel -DB_USERNAME=root -DB_PASSWORD= - -SESSION_DRIVER=database -SESSION_LIFETIME=120 -SESSION_ENCRYPT=false -SESSION_PATH=/ -SESSION_DOMAIN=null -SESSION_SAME_SITE=none -SESSION_SECURE_COOKIE=false - -BROADCAST_CONNECTION=log -FILESYSTEM_DISK=local -QUEUE_CONNECTION=database - -CACHE_STORE=database -# CACHE_PREFIX= - -MEMCACHED_HOST=127.0.0.1 - -REDIS_CLIENT=phpredis -REDIS_HOST=127.0.0.1 -REDIS_PASSWORD=null -REDIS_PORT=6379 - -MAIL_MAILER=log -MAIL_SCHEME=null -MAIL_HOST=127.0.0.1 -MAIL_PORT=2525 -MAIL_USERNAME=null -MAIL_PASSWORD=null -MAIL_FROM_ADDRESS="hello@example.com" -MAIL_FROM_NAME="${APP_NAME}" - -AWS_ACCESS_KEY_ID= -AWS_SECRET_ACCESS_KEY= -AWS_DEFAULT_REGION=us-east-1 -AWS_BUCKET= -AWS_USE_PATH_STYLE_ENDPOINT=false - -VITE_APP_NAME="${APP_NAME}" - -TRUSTED_IP="127.0.0.1" diff --git a/laravel/.gitignore b/laravel/.gitignore deleted file mode 100644 index c7cf1fa..0000000 --- a/laravel/.gitignore +++ /dev/null @@ -1,23 +0,0 @@ -/.phpunit.cache -/node_modules -/public/build -/public/hot -/public/storage -/storage/*.key -/storage/pail -/vendor -.env -.env.backup -.env.production -.phpactor.json -.phpunit.result.cache -Homestead.json -Homestead.yaml -npm-debug.log -yarn-error.log -/auth.json -/.fleet -/.idea -/.nova -/.vscode -/.zed diff --git a/laravel/Dockerfile b/laravel/Dockerfile deleted file mode 100644 index a8892be..0000000 --- a/laravel/Dockerfile +++ /dev/null @@ -1,57 +0,0 @@ -FROM alpine:3.21 - -LABEL authors="amirghasempoor" - -RUN apk update && apk add --no-cache\ - bash \ - wget \ - curl \ - nano \ - unzip \ - libzip-dev \ - libxml2 \ - libxml2-dev \ - git \ - zlib-dev \ - libpng-dev \ - php83 \ - php83-common \ - php83-fpm \ - php83-pdo \ - php83-opcache \ - php83-soap \ - php83-zip \ - php83-phar \ - php83-iconv \ - php83-cli \ - php83-curl \ - php83-openssl \ - php83-mbstring \ - php83-tokenizer \ - php83-fileinfo \ - php83-json \ - php83-xml \ - php83-xmlwriter \ - php83-simplexml \ - php83-dom \ - php83-pdo_mysql \ - php83-pdo_pgsql \ - php83-pdo_sqlite \ - php83-tokenizer \ - php83-pecl-redis - -COPY --from=composer:latest /usr/bin/composer /usr/bin/composer - -ENV COMPOSER_ALLOW_SUPERUSER=1 - -ARG MOUNT_PATH - -WORKDIR /var/www/crm -COPY . . - -CMD composer install;\ - php artisan key:generate;\ - php artisan migrate ;\ - php artisan db:seed;\ -# php artisan storege:link;\ - php artisan serve --host 0.0.0.0 diff --git a/laravel/README.md b/laravel/README.md deleted file mode 100644 index 6851ea9..0000000 --- a/laravel/README.md +++ /dev/null @@ -1,61 +0,0 @@ -

Laravel Logo

- -

-Build Status -Total Downloads -Latest Stable Version -License -

- -## About Laravel - -Laravel is a web application framework with expressive, elegant syntax. We believe development must be an enjoyable and creative experience to be truly fulfilling. Laravel takes the pain out of development by easing common tasks used in many web projects, such as: - -- [Simple, fast routing engine](https://laravel.com/docs/routing). -- [Powerful dependency injection container](https://laravel.com/docs/container). -- Multiple back-ends for [session](https://laravel.com/docs/session) and [cache](https://laravel.com/docs/cache) storage. -- Expressive, intuitive [database ORM](https://laravel.com/docs/eloquent). -- Database agnostic [schema migrations](https://laravel.com/docs/migrations). -- [Robust background job processing](https://laravel.com/docs/queues). -- [Real-time event broadcasting](https://laravel.com/docs/broadcasting). - -Laravel is accessible, powerful, and provides tools required for large, robust applications. - -## Learning Laravel - -Laravel has the most extensive and thorough [documentation](https://laravel.com/docs) and video tutorial library of all modern web application frameworks, making it a breeze to get started with the framework. - -You may also try the [Laravel Bootcamp](https://bootcamp.laravel.com), where you will be guided through building a modern Laravel application from scratch. - -If you don't feel like reading, [Laracasts](https://laracasts.com) can help. Laracasts contains thousands of video tutorials on a range of topics including Laravel, modern PHP, unit testing, and JavaScript. Boost your skills by digging into our comprehensive video library. - -## Laravel Sponsors - -We would like to extend our thanks to the following sponsors for funding Laravel development. If you are interested in becoming a sponsor, please visit the [Laravel Partners program](https://partners.laravel.com). - -### Premium Partners - -- **[Vehikl](https://vehikl.com/)** -- **[Tighten Co.](https://tighten.co)** -- **[Kirschbaum Development Group](https://kirschbaumdevelopment.com)** -- **[64 Robots](https://64robots.com)** -- **[Curotec](https://www.curotec.com/services/technologies/laravel/)** -- **[DevSquad](https://devsquad.com/hire-laravel-developers)** -- **[Redberry](https://redberry.international/laravel-development/)** -- **[Active Logic](https://activelogic.com)** - -## Contributing - -Thank you for considering contributing to the Laravel framework! The contribution guide can be found in the [Laravel documentation](https://laravel.com/docs/contributions). - -## Code of Conduct - -In order to ensure that the Laravel community is welcoming to all, please review and abide by the [Code of Conduct](https://laravel.com/docs/contributions#code-of-conduct). - -## Security Vulnerabilities - -If you discover a security vulnerability within Laravel, please send an e-mail to Taylor Otwell via [taylor@laravel.com](mailto:taylor@laravel.com). All security vulnerabilities will be promptly addressed. - -## License - -The Laravel framework is open-sourced software licensed under the [MIT license](https://opensource.org/licenses/MIT). diff --git a/laravel/database/seeders/PermissionSeeder.php b/laravel/database/seeders/PermissionSeeder.php deleted file mode 100644 index 1e866db..0000000 --- a/laravel/database/seeders/PermissionSeeder.php +++ /dev/null @@ -1,17 +0,0 @@ -name('auth.') - ->controller(AuthController::class) - ->group(function () { - Route::post('/login', 'login')->name('login'); - Route::post('/logout', 'logout')->name('logout'); - }); - -Route::prefix('profile') - ->name('profile.') - ->controller(ProfileController::class) - ->group(function () { - Route::get('/info', 'info')->middleware('auth:sanctum')->name('info'); - Route::post('/change_password', 'changePassword')->middleware('auth:sanctum')->name('changePassword'); - }); - - -Route::prefix('users') - ->name('users.') - ->middleware(['auth:sanctum', 'permission:manage_users']) - ->controller(UserManagementController::class) - ->group(function () { - Route::get('/', 'index')->name('index'); - Route::get('/{user}', 'show')->middleware([SuperAdminCheck::class])->name('show'); - Route::post('/', 'store')->name('store'); - Route::post('/{user}', 'update')->middleware([SuperAdminCheck::class])->name('update'); - Route::delete('/{user}', 'destroy')->middleware([SuperAdminCheck::class])->name('destroy'); - }); - - -Route::prefix('calls') - ->name('calls.') - ->controller(CallController::class) - ->group(function () { - Route::post('/', 'store')->name('store'); - Route::get('/list', 'list')->name('list')->middleware(['auth', 'permission:manage_calls']); - Route::post('/{call}', 'update')->name('update')->middleware(['auth', 'permission:manage_calls']); - }); - -Route::middleware('auth')->get('/categories', [CategoryController::class, 'list'])->name('categories.list'); - - diff --git a/laravel/package.json b/package.json similarity index 100% rename from laravel/package.json rename to package.json diff --git a/laravel/phpunit.xml b/phpunit.xml similarity index 100% rename from laravel/phpunit.xml rename to phpunit.xml diff --git a/laravel/public/.htaccess b/public/.htaccess similarity index 100% rename from laravel/public/.htaccess rename to public/.htaccess diff --git a/laravel/public/favicon.ico b/public/favicon.ico similarity index 100% rename from laravel/public/favicon.ico rename to public/favicon.ico diff --git a/laravel/public/index.php b/public/index.php similarity index 100% rename from laravel/public/index.php rename to public/index.php diff --git a/laravel/public/robots.txt b/public/robots.txt similarity index 100% rename from laravel/public/robots.txt rename to public/robots.txt diff --git a/laravel/public/vendor/telescope/app-dark.css b/public/vendor/telescope/app-dark.css similarity index 100% rename from laravel/public/vendor/telescope/app-dark.css rename to public/vendor/telescope/app-dark.css diff --git a/laravel/public/vendor/telescope/app.css b/public/vendor/telescope/app.css similarity index 100% rename from laravel/public/vendor/telescope/app.css rename to public/vendor/telescope/app.css diff --git a/laravel/public/vendor/telescope/app.js b/public/vendor/telescope/app.js similarity index 100% rename from laravel/public/vendor/telescope/app.js rename to public/vendor/telescope/app.js diff --git a/laravel/public/vendor/telescope/favicon.ico b/public/vendor/telescope/favicon.ico similarity index 100% rename from laravel/public/vendor/telescope/favicon.ico rename to public/vendor/telescope/favicon.ico diff --git a/laravel/public/vendor/telescope/mix-manifest.json b/public/vendor/telescope/mix-manifest.json similarity index 100% rename from laravel/public/vendor/telescope/mix-manifest.json rename to public/vendor/telescope/mix-manifest.json diff --git a/laravel/resources/css/app.css b/resources/css/app.css similarity index 100% rename from laravel/resources/css/app.css rename to resources/css/app.css diff --git a/laravel/resources/js/app.js b/resources/js/app.js similarity index 100% rename from laravel/resources/js/app.js rename to resources/js/app.js diff --git a/laravel/resources/js/bootstrap.js b/resources/js/bootstrap.js similarity index 100% rename from laravel/resources/js/bootstrap.js rename to resources/js/bootstrap.js diff --git a/laravel/resources/lang/en/auth.php b/resources/lang/en/auth.php similarity index 100% rename from laravel/resources/lang/en/auth.php rename to resources/lang/en/auth.php diff --git a/laravel/resources/lang/en/messages.php b/resources/lang/en/messages.php similarity index 100% rename from laravel/resources/lang/en/messages.php rename to resources/lang/en/messages.php diff --git a/laravel/resources/lang/en/pagination.php b/resources/lang/en/pagination.php similarity index 100% rename from laravel/resources/lang/en/pagination.php rename to resources/lang/en/pagination.php diff --git a/laravel/resources/lang/en/passwords.php b/resources/lang/en/passwords.php similarity index 100% rename from laravel/resources/lang/en/passwords.php rename to resources/lang/en/passwords.php diff --git a/laravel/resources/lang/en/validation.php b/resources/lang/en/validation.php similarity index 100% rename from laravel/resources/lang/en/validation.php rename to resources/lang/en/validation.php diff --git a/laravel/resources/lang/fa.json b/resources/lang/fa.json similarity index 100% rename from laravel/resources/lang/fa.json rename to resources/lang/fa.json diff --git a/laravel/resources/lang/fa/auth.php b/resources/lang/fa/auth.php similarity index 100% rename from laravel/resources/lang/fa/auth.php rename to resources/lang/fa/auth.php diff --git a/laravel/resources/lang/fa/messages.php b/resources/lang/fa/messages.php similarity index 100% rename from laravel/resources/lang/fa/messages.php rename to resources/lang/fa/messages.php diff --git a/laravel/resources/lang/fa/pagination.php b/resources/lang/fa/pagination.php similarity index 100% rename from laravel/resources/lang/fa/pagination.php rename to resources/lang/fa/pagination.php diff --git a/laravel/resources/lang/fa/passwords.php b/resources/lang/fa/passwords.php similarity index 100% rename from laravel/resources/lang/fa/passwords.php rename to resources/lang/fa/passwords.php diff --git a/laravel/resources/lang/fa/validation.php b/resources/lang/fa/validation.php similarity index 100% rename from laravel/resources/lang/fa/validation.php rename to resources/lang/fa/validation.php diff --git a/laravel/resources/views/vendor/pulse/dashboard.blade.php b/resources/views/vendor/pulse/dashboard.blade.php similarity index 100% rename from laravel/resources/views/vendor/pulse/dashboard.blade.php rename to resources/views/vendor/pulse/dashboard.blade.php diff --git a/laravel/resources/views/welcome.blade.php b/resources/views/welcome.blade.php similarity index 100% rename from laravel/resources/views/welcome.blade.php rename to resources/views/welcome.blade.php diff --git a/laravel/routes/api.php b/routes/api.php similarity index 100% rename from laravel/routes/api.php rename to routes/api.php diff --git a/laravel/routes/console.php b/routes/console.php similarity index 100% rename from laravel/routes/console.php rename to routes/console.php diff --git a/routes/web.php b/routes/web.php new file mode 100644 index 0000000..332bbfb --- /dev/null +++ b/routes/web.php @@ -0,0 +1,54 @@ +group(function () { + Route::prefix('auth') + ->name('auth.') + ->controller(AuthController::class) + ->group(function () { + Route::post('/login', 'login')->name('login'); + Route::post('/logout', 'logout')->name('logout'); + }); + + Route::prefix('profile') + ->name('profile.') + ->controller(ProfileController::class) + ->group(function () { + Route::get('/info', 'info')->middleware('auth:sanctum')->name('info'); + Route::post('/change_password', 'changePassword')->middleware('auth:sanctum')->name('changePassword'); + }); + + Route::prefix('users') + ->name('users.') + ->middleware(['auth:sanctum', 'permission:manage_users']) + ->controller(UserManagementController::class) + ->group(function () { + Route::get('/', 'index')->name('index'); + Route::get('/{user}', 'show')->middleware([SuperAdminCheck::class])->name('show'); + Route::post('/', 'store')->name('store'); + Route::post('/{user}', 'update')->middleware([SuperAdminCheck::class])->name('update'); + Route::delete('/{user}', 'destroy')->middleware([SuperAdminCheck::class])->name('destroy'); + }); + + Route::prefix('calls') + ->name('calls.') + ->controller(CallController::class) + ->group(function () { + Route::post('/', 'store')->name('store'); + Route::get('/list', 'list')->name('list')->middleware(['auth', 'permission:manage_calls']); + Route::post('/{call}', 'update')->name('update')->middleware(['auth', 'permission:manage_calls']); + }); + + Route::middleware('auth') + ->controller(CategoryController::class) + ->group(function () { + Route::get('/categories', 'list'); + }); +}); diff --git a/laravel/storage/app/.gitignore b/storage/app/.gitignore old mode 100644 new mode 100755 similarity index 100% rename from laravel/storage/app/.gitignore rename to storage/app/.gitignore diff --git a/laravel/storage/app/private/.gitignore b/storage/app/private/.gitignore old mode 100644 new mode 100755 similarity index 100% rename from laravel/storage/app/private/.gitignore rename to storage/app/private/.gitignore diff --git a/laravel/storage/app/public/.gitignore b/storage/app/public/.gitignore old mode 100644 new mode 100755 similarity index 100% rename from laravel/storage/app/public/.gitignore rename to storage/app/public/.gitignore diff --git a/laravel/storage/framework/.gitignore b/storage/framework/.gitignore old mode 100644 new mode 100755 similarity index 100% rename from laravel/storage/framework/.gitignore rename to storage/framework/.gitignore diff --git a/laravel/storage/framework/cache/.gitignore b/storage/framework/cache/.gitignore old mode 100644 new mode 100755 similarity index 100% rename from laravel/storage/framework/cache/.gitignore rename to storage/framework/cache/.gitignore diff --git a/laravel/storage/framework/cache/data/.gitignore b/storage/framework/cache/data/.gitignore old mode 100644 new mode 100755 similarity index 100% rename from laravel/storage/framework/cache/data/.gitignore rename to storage/framework/cache/data/.gitignore diff --git a/laravel/storage/framework/sessions/.gitignore b/storage/framework/sessions/.gitignore old mode 100644 new mode 100755 similarity index 100% rename from laravel/storage/framework/sessions/.gitignore rename to storage/framework/sessions/.gitignore diff --git a/laravel/storage/framework/testing/.gitignore b/storage/framework/testing/.gitignore old mode 100644 new mode 100755 similarity index 100% rename from laravel/storage/framework/testing/.gitignore rename to storage/framework/testing/.gitignore diff --git a/laravel/storage/framework/views/.gitignore b/storage/framework/views/.gitignore old mode 100644 new mode 100755 similarity index 100% rename from laravel/storage/framework/views/.gitignore rename to storage/framework/views/.gitignore diff --git a/laravel/storage/logs/.gitignore b/storage/logs/.gitignore old mode 100644 new mode 100755 similarity index 100% rename from laravel/storage/logs/.gitignore rename to storage/logs/.gitignore diff --git a/laravel/storage/sql-files/cities.sql b/storage/sql-files/cities.sql old mode 100644 new mode 100755 similarity index 100% rename from laravel/storage/sql-files/cities.sql rename to storage/sql-files/cities.sql diff --git a/laravel/storage/sql-files/provinces.sql b/storage/sql-files/provinces.sql old mode 100644 new mode 100755 similarity index 100% rename from laravel/storage/sql-files/provinces.sql rename to storage/sql-files/provinces.sql diff --git a/laravel/tests/Feature/ExampleTest.php b/tests/Feature/ExampleTest.php similarity index 100% rename from laravel/tests/Feature/ExampleTest.php rename to tests/Feature/ExampleTest.php diff --git a/laravel/tests/TestCase.php b/tests/TestCase.php similarity index 100% rename from laravel/tests/TestCase.php rename to tests/TestCase.php diff --git a/laravel/tests/Unit/ExampleTest.php b/tests/Unit/ExampleTest.php similarity index 100% rename from laravel/tests/Unit/ExampleTest.php rename to tests/Unit/ExampleTest.php diff --git a/laravel/vite.config.js b/vite.config.js similarity index 100% rename from laravel/vite.config.js rename to vite.config.js