{"id":16202011,"url":"https://github.com/atymic/laravel-collection-playground","last_synced_at":"2025-10-10T14:10:38.252Z","repository":{"id":39368386,"uuid":"202496518","full_name":"atymic/laravel-collection-playground","owner":"atymic","description":"Test, Run \u0026 Share Laravel Collection Examples!","archived":false,"fork":false,"pushed_at":"2023-01-04T11:30:38.000Z","size":2677,"stargazers_count":52,"open_issues_count":35,"forks_count":6,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-06-16T10:00:23.515Z","etag":null,"topics":["collections","functional-programming","laravel","laravel-collections","laravel-framework","playground"],"latest_commit_sha":null,"homepage":"https://collection-playground.atymic.dev","language":"Vue","has_issues":true,"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/atymic.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}},"created_at":"2019-08-15T07:40:57.000Z","updated_at":"2024-07-11T15:44:40.000Z","dependencies_parsed_at":"2023-02-02T10:30:42.934Z","dependency_job_id":null,"html_url":"https://github.com/atymic/laravel-collection-playground","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/atymic/laravel-collection-playground","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/atymic%2Flaravel-collection-playground","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/atymic%2Flaravel-collection-playground/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/atymic%2Flaravel-collection-playground/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/atymic%2Flaravel-collection-playground/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/atymic","download_url":"https://codeload.github.com/atymic/laravel-collection-playground/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/atymic%2Flaravel-collection-playground/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279004181,"owners_count":26083688,"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","status":"online","status_checked_at":"2025-10-10T02:00:06.843Z","response_time":62,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":["collections","functional-programming","laravel","laravel-collections","laravel-framework","playground"],"created_at":"2024-10-10T09:45:14.849Z","updated_at":"2025-10-10T14:10:38.191Z","avatar_url":"https://github.com/atymic.png","language":"Vue","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Laravel Collection Playground\n\n[Laravel's collections](https://laravel.com/docs/5.8/collections) are awesome!  \nThis project provides a \"jsfiddle\" style environment to test, run \u0026 share collection code.\n\n### It runs in the browser? :astonished:\nThe playground uses [pib](https://github.com/oraoto/pib) to evaluate PHP code directly inside the browser.  \nWhen you load the playground, Vue downloads a compiled web assembly build of PHP. This is used by they playground to\nlocally eval your code as you type.\n\nThe disadvantages of this approach are the limited browser support - for it to work you need to be running a desktop\nversion of Chrome or Firefox that is recent. Safari \u0026 Edge aren't support at the moment.\nSee [this issue](https://github.com/atymic/laravel-collection-playground/issues/2) for more information.\n\n### It works without internet? :mobile_phone_off:\nThe playground is built as a PWA, which provides several advantages. \n\n- Caching of downloaded PHP binary (no need to re-download the binary on each page load)\n- Support for using offline (since the code is eval'd locally, it will work without any internet)\n\n## Project Details\n\n### Folder Structure\n - `api` contains the lambda function that is used to save playground as github gists, so they can be saved \u0026 shared. \n - `php-app` contain a small PHP application that is used to evaluate the collection code, catch errors and return it \n back to the client as json.\n - `php-src` contains the scripts to build the in web assembly build, containing PHP + the `php-app` code.\n - `playground` contains the Vue application which communicates with PHP to run your code, and display the results\n\n### Building\n#### PHP\n```bash\nphp php-app/create-phar.php php-src/app.phar # create the phar containing the PHP code\ncd php-src # Swtich to the pib dir\ndocker run --rm -v $(pwd):/src trzeci/emscripten:sdk-incoming-64bit bash build.sh # Build PHP\ncp php-7.3.6/php.wasm php-7.3.6/php.js php-7.3.6/php.data ../playground/public # Copy the compiled files into the playground\n```\n\n#### Playground\n```bash\ncd playground\nyarn # Install deps\nyarn serve # Development\nyarn build # Production build to `dist` folder\n```\n\n## Contributing\nPRs are welcome! Feel free to improve the documentation, fix bugs and help make the playground better!\nIssues are welcome as well if you find a bug or improvement.\n\n## Further Reading\nThe [Laravel Collections](https://laravel.com/docs/5.8/collections) documentation.\n\nAdam Wathan has a great course, [Refactoring to Collections](https://adamwathan.me/refactoring-to-collections/) \nwhich provides tons of content on refactoring your Laravel to take advantage of collections.\n\n## Credits\nThe in-browser PHP evaluation uses [PHP in Browser](https://github.com/oraoto/pib) by oraoto\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fatymic%2Flaravel-collection-playground","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fatymic%2Flaravel-collection-playground","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fatymic%2Flaravel-collection-playground/lists"}