{"id":29093058,"url":"https://github.com/io-digital/truncate-tables","last_synced_at":"2026-04-28T01:31:13.399Z","repository":{"id":56992948,"uuid":"363546229","full_name":"io-digital/truncate-tables","owner":"io-digital","description":"A Laravel package to easily truncate database tables when running seeder files","archived":false,"fork":false,"pushed_at":"2021-05-02T13:20:38.000Z","size":254,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-06-26T09:50:19.115Z","etag":null,"topics":["database","laravel","php","seeder","truncate"],"latest_commit_sha":null,"homepage":"","language":"PHP","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/io-digital.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":".github/CONTRIBUTING.md","funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":".github/SECURITY.md","support":null}},"created_at":"2021-05-02T01:59:15.000Z","updated_at":"2021-05-06T09:48:34.000Z","dependencies_parsed_at":"2022-08-21T13:20:25.415Z","dependency_job_id":null,"html_url":"https://github.com/io-digital/truncate-tables","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/io-digital/truncate-tables","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/io-digital%2Ftruncate-tables","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/io-digital%2Ftruncate-tables/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/io-digital%2Ftruncate-tables/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/io-digital%2Ftruncate-tables/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/io-digital","download_url":"https://codeload.github.com/io-digital/truncate-tables/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/io-digital%2Ftruncate-tables/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":262371949,"owners_count":23300616,"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":["database","laravel","php","seeder","truncate"],"created_at":"2025-06-28T08:02:06.483Z","updated_at":"2026-04-28T01:31:08.378Z","avatar_url":"https://github.com/io-digital.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# A Laravel package to easily truncate database tables when running seeder files\n\n[![Latest Version on Packagist](https://img.shields.io/packagist/v/io-digital/truncate-tables.svg?style=flat-square)](https://packagist.org/packages/io-digital/truncate-tables)\n[![GitHub Tests Action Status](https://img.shields.io/github/workflow/status/io-digital/truncate-tables/run-tests?label=tests)](https://github.com/io-digital/truncate-tables/actions?query=workflow%3Arun-tests+branch%3Amaster)\n[![GitHub Code Style Action Status](https://img.shields.io/github/workflow/status/io-digital/truncate-tables/Check%20\u0026%20fix%20styling?label=code%20style)](https://github.com/io-digital/truncate-tables/actions?query=workflow%3A\"Check+%26+fix+styling\"+branch%3Amaster)\n[![Total Downloads](https://img.shields.io/packagist/dt/io-digital/truncate-tables.svg?style=flat-square)](https://packagist.org/packages/io-digital/truncate-tables)\n\n## Installation\n\nYou can install the package via composer:\n\n```bash\ncomposer require io-digital/truncate-tables\n```\n\n## Usage\n\nIn `database/seeders/DatabaseSeeder.php`:\n\n```php\n\u003c?php\n\nnamespace Database\\Seeders;\n\nuse Illuminate\\Database\\Seeder;\nuse IoDigital\\TruncateTable\\TruncateTable;\n\nclass DatabaseSeeder extends Seeder\n{\n    /**\n     * Seed the application's database.\n     *\n     * @return void\n     */\n    public function run()\n    {\n        TruncateTable::fromArrays([\n            'users',\n            'posts'\n        ])-\u003eclean();\n        \n        // Or like the following\n        \n        TruncateTable::fromArrays([\n            'users',\n            'posts'\n        ], [\n            UserTableSeeder::class,\n            PostTableSeeder::class,\n        ])-\u003ecleanAndSeed();\n    }\n}\n```\n\n## Testing\n\n```bash\ncomposer test\n```\n\n## Changelog\n\nPlease see [CHANGELOG](CHANGELOG.md) for more information on what has changed recently.\n\n## Contributing\n\nPlease see [CONTRIBUTING](.github/CONTRIBUTING.md) for details.\n\n## Credits\n\n- [Gareth Nicholson](https://github.com/io-digital)\n- [All Contributors](../../contributors)\n\n## License\n\nThe MIT License (MIT). Please see [License File](LICENSE.md) for more information.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fio-digital%2Ftruncate-tables","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fio-digital%2Ftruncate-tables","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fio-digital%2Ftruncate-tables/lists"}