{"id":21340275,"url":"https://github.com/mnestorov/laravel-import-file","last_synced_at":"2026-05-18T15:12:33.890Z","repository":{"id":157718945,"uuid":"633606772","full_name":"mnestorov/laravel-import-file","owner":"mnestorov","description":"This is a test project to import the data from a file into a mysql database with artisan command.","archived":false,"fork":false,"pushed_at":"2023-10-09T12:38:38.000Z","size":406,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-09-04T07:29:52.335Z","etag":null,"topics":["artisan-command","laravel","laravel-application","laravel-artisan","laravel-artisan-command","laravel-file-upload","laravel-framework","laravel-mysql","php"],"latest_commit_sha":null,"homepage":"","language":"PHP","has_issues":false,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mnestorov.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2023-04-27T22:08:11.000Z","updated_at":"2023-11-30T14:02:40.000Z","dependencies_parsed_at":"2023-06-09T08:30:23.845Z","dependency_job_id":null,"html_url":"https://github.com/mnestorov/laravel-import-file","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/mnestorov/laravel-import-file","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mnestorov%2Flaravel-import-file","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mnestorov%2Flaravel-import-file/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mnestorov%2Flaravel-import-file/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mnestorov%2Flaravel-import-file/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mnestorov","download_url":"https://codeload.github.com/mnestorov/laravel-import-file/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mnestorov%2Flaravel-import-file/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33181967,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-18T09:27:30.708Z","status":"ssl_error","status_checked_at":"2026-05-18T09:27:28.300Z","response_time":71,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["artisan-command","laravel","laravel-application","laravel-artisan","laravel-artisan-command","laravel-file-upload","laravel-framework","laravel-mysql","php"],"created_at":"2024-11-22T00:49:55.690Z","updated_at":"2026-05-18T15:12:28.875Z","avatar_url":"https://github.com/mnestorov.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cp align=\"center\"\u003e\u003ca href=\"https://laravel.com\" target=\"_blank\"\u003e\u003cimg src=\"https://raw.githubusercontent.com/laravel/art/master/logo-lockup/5%20SVG/2%20CMYK/1%20Full%20Color/laravel-logolockup-cmyk-red.svg\" width=\"400\" alt=\"Laravel Logo\"\u003e\u003c/a\u003e\u003c/p\u003e\n\n# Laravel Import File with Artisan Command\n\n[![Licence](https://img.shields.io/github/license/Ileriayo/markdown-badges?style=for-the-badge)](./LICENSE)\n\n## Overview\n\nThis is a test project to import the data from a file into a mysql database with artisan command.\n\n## Task Definition\n\nUsing Laravel create an Artisan command called `import_file` that accepts two arguments - `path_to_file` and `id`. The command should parse the attached file `PAYARC_DDF` that has a fixed width text format and import the data into a mysql database. On each line of the file there is a Record, that has two symbol unique Record Type which starts from position 18, for example: \"DT\", \"P1\", \"P2\", etc. Each individual Record Type has its own fixed width scheme that determines the Start and End of each column. You can find the full scheme specification in the attached file `import_file_specs.csv`. The `id` parameter of the command uniquely identifies a file. Any consecutive import of a file with the same id should not result in duplicating the Records that have already been imported.\n\n## How To Run\n\n- Clone the repository to your local machine and navigate to the project's root directory in a terminal.\n- Copy the `.env.example` file and name it `.env`.\n- Update the `.env` file with the appropriate database credentials and settings.\n- Run `composer install` to install all the required dependencies.\n- Generate an application key by running `php artisan key:generate`.\n- Run database migrations by running `php artisan migrate`.\n- Run database seeds by running `php artisan db:seed`.\n- Run the Laravel server by running `php artisan serve`.\n- To import a file, run `php artisan import_file /path/to/file file_id`. Replace `/path/to/file` with the actual path to the file you want to import and `file_id` with an integer value that uniquely identifies the file you're importing.\n- To check if there are any pending jobs in the queue, run `php artisan queue:work`. This will start a worker process that will listen for jobs and execute them as they come in.\n\n**Note:** Make sure you have a running Redis or database queue driver configured to process queued jobs. You can check your queue driver settings in the `.env` file.\n\n## About Laravel\n\nLaravel 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:\n\n- [Simple, fast routing engine](https://laravel.com/docs/routing).\n- [Powerful dependency injection container](https://laravel.com/docs/container).\n- Multiple back-ends for [session](https://laravel.com/docs/session) and [cache](https://laravel.com/docs/cache) storage.\n- Expressive, intuitive [database ORM](https://laravel.com/docs/eloquent).\n- Database agnostic [schema migrations](https://laravel.com/docs/migrations).\n- [Robust background job processing](https://laravel.com/docs/queues).\n- [Real-time event broadcasting](https://laravel.com/docs/broadcasting).\n\nLaravel is accessible, powerful, and provides tools required for large, robust applications.\n\n--- \n\n## License\n\nThis project is released under the MIT License.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmnestorov%2Flaravel-import-file","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmnestorov%2Flaravel-import-file","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmnestorov%2Flaravel-import-file/lists"}