{"id":17228539,"url":"https://github.com/simshaun/laravel-plant","last_synced_at":"2025-10-07T02:11:22.030Z","repository":{"id":3730566,"uuid":"4804076","full_name":"simshaun/laravel-plant","owner":"simshaun","description":"Plant is a Laravel bundle that offers an easy way to seed your project with data using \"seeds\" (data fixtures). DISCLAIMER: This package is no longer maintained since Laravel came out with its own seeding mechanism.","archived":false,"fork":false,"pushed_at":"2013-01-20T18:01:32.000Z","size":150,"stargazers_count":17,"open_issues_count":1,"forks_count":5,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-27T15:21:48.798Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"PHP","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/simshaun.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}},"created_at":"2012-06-27T03:51:49.000Z","updated_at":"2020-02-04T04:45:33.000Z","dependencies_parsed_at":"2022-07-28T20:29:06.739Z","dependency_job_id":null,"html_url":"https://github.com/simshaun/laravel-plant","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/simshaun%2Flaravel-plant","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/simshaun%2Flaravel-plant/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/simshaun%2Flaravel-plant/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/simshaun%2Flaravel-plant/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/simshaun","download_url":"https://codeload.github.com/simshaun/laravel-plant/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248805585,"owners_count":21164356,"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":[],"created_at":"2024-10-15T04:44:25.712Z","updated_at":"2025-10-07T02:11:17.012Z","avatar_url":"https://github.com/simshaun.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Plant\n\nPlant is a bundle for Laravel that offers an easy way to seed your project and/or tests with data using \"seeds\".\nWorks well in combination with the excellent [Faker library](https://github.com/fzaninotto/Faker).\n\n---\n\n## Getting started\n\n 1. Install by running `php artisan bundle:install plant`\n 2. Enable the `plant` bundle in application/bundles.php\n 3. Create a `seeds` folder in your application directory.\n 4. Create seed files. For example:\n\n        \u003c?php // file: /application/seeds/users.php\n\n        class Seed_Users extends \\S2\\Seed {\n\n            public function grow()\n            {\n                $user = new User;\n                $user-\u003eusername = 'johndoe';\n                $user-\u003epassword = '12345678';\n                $user-\u003esave();\n\n                $user = new User;\n                $user-\u003eusername = 'janedoe';\n                $user-\u003epassword = '12345678';\n                $user-\u003esave();\n            }\n\n            // This is optional. It lets you specify the order each seed is grown.\n            // Seeds with a lower number are grown first.\n            public function order()\n            {\n                return 100;\n            }\n\n        }\n\n---\n\n### Controlling the order that seeds are grown\nEach seed class may contain an `order()` method that returns a sort order integer.\nSeeds with a lower sort order are grown first.\n\n---\n\n## Growing Seeds\n\n### All at once\nrun `php artisan plant::seed all`\n\n#### Excluding seeds\nYou can exclude specific seeds from being grown by using the `--not` option.\nSeparate multiple exclusions with a comma.\n\ne.g. `php artisan plant::seed all --not=users,posts`\n\n\n### Multiple seeds (e.g. users,posts)\nrun `php artisan plant::seed users,posts`\n\n \u003e Regardless of the order you list the seeds in the CLI command, Plant will always grow\n \u003e them according to each seed's sort order.\n\n\n### Individual seeds (e.g. users)\nrun `php artisan plant::seed users`\n\n \u003e If multiple seeds with the same filename exist, they will all be grown.\n \u003e This could happen when seeds are stored in bundles.\n \u003e e.g. **application/seeds/users.php** and **bundles/plant/seeds/users.php**\n \u003e\n \u003e *Sort orders are still used.*\n\n---\n\n## References\n\nIf a seed needs to reference an object that was created in another seed,\nuse the references feature as shown below.\n\n\n    \u003c?php // file: /application/seeds/users.php\n\n    class Seed_Users extends \\S2\\Seed {\n\n        public function grow()\n        {\n            $user = new User;\n            $user-\u003eusername = 'johndoe';\n            $user-\u003epassword = '12345678';\n            $user-\u003esave();\n\n            $this-\u003eaddReference('user-a', $user);\n        }\n\n        public function order()\n        {\n            return 100;\n        }\n\n    }\n\n-\n\n    \u003c?php // file: /application/seeds/posts.php\n\n    class Seed_Posts extends \\S2\\Seed {\n\n        public function grow()\n        {\n            $post = new Post;\n            $post-\u003euser_id = $this-\u003egetReference('user-a')-\u003eid;\n            $post-\u003etitle = 'Lorem Ipsum Foo Foo';\n            $post-\u003esave();\n        }\n\n        // This seed must be grown after the users seed\n        // so that it can access the \"user-a\" reference.\n        public function order()\n        {\n            return 200;\n        }\n\n    }\n\n---\n\n## Issues\n\nIf you find any bugs or have suggestions, please add them to the\n[Issue Tracker](https://github.com/simshaun/laravel-plant/issues).","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsimshaun%2Flaravel-plant","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsimshaun%2Flaravel-plant","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsimshaun%2Flaravel-plant/lists"}