{"id":14974444,"url":"https://github.com/pionl/laravel-chunk-upload-example","last_synced_at":"2025-04-06T08:13:48.719Z","repository":{"id":18473621,"uuid":"81219263","full_name":"pionl/laravel-chunk-upload-example","owner":"pionl","description":"Example project for laravel-chunk-upload","archived":false,"fork":false,"pushed_at":"2025-03-19T16:53:42.000Z","size":7236,"stargazers_count":69,"open_issues_count":1,"forks_count":36,"subscribers_count":5,"default_branch":"master","last_synced_at":"2025-03-30T06:11:08.903Z","etag":null,"topics":["example-project","laravel5"],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/pionl.png","metadata":{"files":{"readme":"readme.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null},"funding":{"github":["pionl"],"custom":["https://revolut.me/martinpv7n"]}},"created_at":"2017-02-07T14:51:49.000Z","updated_at":"2025-03-26T05:34:54.000Z","dependencies_parsed_at":"2025-03-30T06:10:52.822Z","dependency_job_id":"6f7e05d5-cc54-44d2-8d63-0f5220ee433a","html_url":"https://github.com/pionl/laravel-chunk-upload-example","commit_stats":{"total_commits":30,"total_committers":5,"mean_commits":6.0,"dds":"0.30000000000000004","last_synced_commit":"8b184f594869320acdf7eb2ce7061ee02d1c5ab3"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pionl%2Flaravel-chunk-upload-example","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pionl%2Flaravel-chunk-upload-example/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pionl%2Flaravel-chunk-upload-example/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pionl%2Flaravel-chunk-upload-example/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/pionl","download_url":"https://codeload.github.com/pionl/laravel-chunk-upload-example/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247451665,"owners_count":20940944,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":["example-project","laravel5"],"created_at":"2024-09-24T13:50:34.379Z","updated_at":"2025-04-06T08:13:48.692Z","avatar_url":"https://github.com/pionl.png","language":"JavaScript","funding_links":["https://github.com/sponsors/pionl","https://revolut.me/martinpv7n"],"categories":[],"sub_categories":[],"readme":"# Laravel Chunked Upload Example\n\n\u003e This example covers all supported versions of Laravel. This implementation allows testing across all versions simultaneously.\n\nThis repository contains a full example for the [laravel-chunk-upload](https://github.com/pionl/laravel-chunk-upload) package. You can either explore an example app or run tests against all supported versions of Laravel.\n\n* [Usage](#usage)\n* [Compatibility](#compatibility)\n* [Running Tests](#tests)\n* [Example Code](#example-code)\n* [Testing Your Contribution](#testing-your-contribution)\n* [Contribution](#contribution)\n\n## Install\n\n```bash\ngit clone git@github.com:pionl/laravel-chunk-upload-example.git --recurse-submodules\nnpm install\n```\n\n## Requirements\n\n- PHP Installed if running locally\n- Node.js\n- Docker and Docker Compose installed\n\n## Usage\n\n**To install and run a specific version of Laravel, use the X.\\* version format.**\n\n```bash\nnode run.js \"8.*\"\n```\n\n\u003e Pass _--ignore-example_ to ignore updating and building the example.\n\u003e \n\u003e Pass _--verbose_ for debug information.\n\nOpen http://localhost:8000\n\n## Compatibility\n\n\u003e The current version of laravel-chunk-upload is tested against:\n\n| Laravel | PHP                                   | Run               | Tests                  |\n|---------|---------------------------------------|-------------------|------------------------|\n| 12.*    | 8.2-node-20                           | `node run \"12.*\"` | `node tests.js \"12.*\"` |\n| 11.*    | 8.2-node-20                           | `node run \"11.*\"` | `node tests.js \"11.*\"` |\n| 10.*    | 8.1-node-17, 8.2-node-18              | `node run \"10.*\"` | `node tests.js \"10.*\"` |\n| 9.*     | 8.0-node-17, 8.1-node-17, 8.2-node-18 | `node run \"9.*\"`  | `node tests.js \"9.*\"`  |\n| 8.*     | 7.4-node-17, 8.0-node-17, 8.1-node-17 | `node run \"8.*\"`  | `node tests.js \"8.*\"`  |\n| 7.*     | 7.4-node-17                           | `node run \"7.*\"`  | `node tests.js \"7.*\"`  |\n\n## Tests\n\n\u003e Pass --verbose for debug information.\n\n**Run tests on all Laravel versions (install them before using it) using docker**\n\n```bash\nnode tests.js\n```\n\n**Run tests on a desired Laravel version**\n\n```bash\nnode tests.js \"8.*\"\n```\n\n### Running Tests Locally\n\n* In one terminal, run `php 7.\\*/artisan serve --host=0.0.0.0 --port=8000`.\n* In a second terminal, run tests with `./node_modules/.bin/codeceptjs run --steps`.\n* `npm run test-debug` will show the browser while tests are running.\n\n### Docker-Compose\n\n* Environment variables should be passed: `IMAGE_VERSION` (PHP version) and `LARAVEL_VERSION`.\n* `abort-on-container-exit` needs to be used to stop the Laravel server.\n\n```bash\nIMAGE_VERSION=8.2-node-20 LARAVEL_VERSION=12.\\* docker compose -f docker-compose.yml -f docker-compose-tests.yml up --abort-on-container-exit\n```\n\nWe are using docker images built for [Laravel](https://github.com/pionl/docker-php-laravel-ci)\n\n## Testing Your Contribution\n\n\u003e Do not commit your changes - use a pull request in the main repo.\n\n* Replace the `laravel-chunk-upload` folder with your repository (clone your fork).\n* Or you can pull changes from your fork with with given bash script:\n\n```bash\npr.sh \u003cyour-github-username\u003e \u003cbranch = default is master\u003e \u003crepository-name = laravel-chunk-upload\u003e\n```\n* Run tests on all versions with `node tests.js` to ensure backward compatibility.\n\n### Getting current master when PR is merged\n\n```\nbash update.sh\n```\n\n## Adding Support for a New Laravel Release\n\n- Docker and Docker Compose installed.\n- Node.js installed.\n\n\u003e Do not commit your changes - use a pull request in the main repo.\n\n* Add a new version to the `versions.json` file.\n* Add your changes to the `laravel-chunk-upload` folder.\n* Test the Laravel version with `node tests.js \"10.\\*\"`.\n* Run tests on all versions with `node tests.js` to ensure backward compatibility.\n\n## Example Code\n\n* **Controller - Dynamic Usage** at [./example/src/Http/Controllers/UploadController.php](./example/src/Http/Controllers/UploadController.php)\n* **Views** at [./example/resources/views/example/](./example/resources/views/example/) - Here, you can find a basic layout for the providers.\n* **JavaScript** at [./example/resources/assets/js/](./example/resources/assets/js/) - Here, you can find the initial setup for the providers.\n\n### Uploading to Amazon S3 (or Any Other Cloud Storage)\n\n* It is recommended to upload the file in a separate queue JOB. Uploading can take time (for large files), and the request could get timed out.\n* It is important to stream the file to the cloud (not using `file_get_contents`), which would consume your memory.\n* Also, don't forget to remove the uploaded file after the upload.\n\nExample code found at [./example/src/Http/Controllers/UploadController.php](./example/src/Http/Controllers/UploadController.php#L59).\n\n\n## Contribution\n\n* If you make changes in assets, do not forget to call `node compile.js` to compile the changes and publish them to all versions (you can also pass the desired version).\n\n# TODO\n\n- Improve example controller.\n- Add tests to Dropzone.\n- Clean storage after tests.\n- Add tests for parallel save.\n\n### Running Tests on the Latest Laravel Release\n\n**I did not find a way to install Laravel on master with the latest changes from the framework. Let me know if you know how.**\n\n\n## Copyright and License\n\n[laravel-chunk-upload-example](https://github.com/pionl/laravel-chunk-upload-example)\nwas written by [Martin Kluska](http://kluska.cz) and is released under the\n[MIT License](LICENSE.md).\n\nCopyright (c) 2017 and beyond Martin Kluska and all the contributors (Thank you ❤️)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpionl%2Flaravel-chunk-upload-example","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpionl%2Flaravel-chunk-upload-example","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpionl%2Flaravel-chunk-upload-example/lists"}