{"id":16668296,"url":"https://github.com/andreaselia/laravel-cruddy","last_synced_at":"2026-04-27T13:31:54.715Z","repository":{"id":96509778,"uuid":"449285599","full_name":"andreaselia/laravel-cruddy","owner":"andreaselia","description":"WORK IN PROGRESS. Livewire Cruddy helps speed up the development of Laravel apps using the TALL stack and opinionated hook-style integration.","archived":false,"fork":false,"pushed_at":"2022-02-22T20:00:42.000Z","size":128,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-12-30T22:32:24.762Z","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":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/andreaselia.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","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":["andreaselia"]}},"created_at":"2022-01-18T13:00:04.000Z","updated_at":"2022-12-09T14:07:48.000Z","dependencies_parsed_at":"2023-03-13T16:30:18.655Z","dependency_job_id":null,"html_url":"https://github.com/andreaselia/laravel-cruddy","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/andreaselia/laravel-cruddy","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/andreaselia%2Flaravel-cruddy","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/andreaselia%2Flaravel-cruddy/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/andreaselia%2Flaravel-cruddy/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/andreaselia%2Flaravel-cruddy/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/andreaselia","download_url":"https://codeload.github.com/andreaselia/laravel-cruddy/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/andreaselia%2Flaravel-cruddy/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32339289,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-26T23:26:28.701Z","status":"online","status_checked_at":"2026-04-27T02:00:06.769Z","response_time":128,"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":[],"created_at":"2024-10-12T11:24:17.093Z","updated_at":"2026-04-27T13:31:54.696Z","avatar_url":"https://github.com/andreaselia.png","language":"PHP","funding_links":["https://github.com/sponsors/andreaselia"],"categories":[],"sub_categories":[],"readme":"# Laravel Cruddy\n\nLivewire Cruddy helps speed up the development of Laravel apps using the TALL stack and opinionated hook-style integration.\n\n![Laravel Livewire Cruddy](/screenshot.jpg?raw=true \"Laravel Cruddy\")\n\n## Installation\n\nInstall the package:\n\n```bash\ncomposer require notano/laravel-cruddy\n```\n\n## Component\n\nMaking an existing component Cruddy friendly is as easy as extending `CrudComponent` and consuming the methods documented below. Here is a guide component:\n\n```php\n\u003c?php\n\nnamespace App\\Http\\Livewire\\Clients;\n\nclass Form extends CrudComponent\n{\n    public function mount(Client $client)\n    {\n        if ($client-\u003eexists) {\n            $this-\u003eclient = $client;\n            $this-\u003estate = $client-\u003etoArray();\n            $this-\u003esetTarget('update');\n        }\n    }\n\n    public function onCreate(array $data)\n    {\n        Client::create($data);\n\n        $this-\u003eredirectRoute('clients.index');\n    }\n\n    public function onUpdate(array $data)\n    {\n        $this-\u003eclient-\u003eupdate($data);\n\n        $this-\u003eredirectRoute('clients.edit', $this-\u003eclient);\n    }\n\n    public function onDelete()\n    {\n        $this-\u003eclient-\u003edelete();\n\n        $this-\u003eredirectRoute('clients.index');\n    }\n}\n```\n\n## Methods\n\n### setupFlashMessages\n\nThis method allows you to automatically flash messages relevant to the creation/update/deletion of a record. The messages can also be customised. All messages are flashed with the \"status\" key.\n\n```php\npublic function mount(Post $post)\n{\n    // Default:\n    $this-\u003esetupFlashMessages();\n\n    // Replace \"record\" with a custom type:\n    $this-\u003esetupFlashMessages([], 'user');\n\n    // Custom messages:\n    $this-\u003esetupFlashMessages([\n        'create' =\u003e 'The record may have been created successfully.',\n        'update' =\u003e 'The record may have been updated successfully.',\n        'delete' =\u003e 'The record may have been deleted successfully.',\n    ]);\n}\n```\n\n### beforeCreate/beforeUpdate\n\nThese methods allow you to modify the data before inserting or updating.\n\n```php\npublic function beforeCreate(array $input)\n{\n    return array_merge($input, [\n        'uuid' =\u003e Str::uuid(),\n    ]);\n}\n\npublic function beforeUpdate(array $input)\n{\n    return array_merge($input, [\n        'slug' =\u003e Str::slug($input['title']),\n    ]);\n}\n```\n\n### onCreate/onUpdate/onDelete\n\nThese methods are the main ones for all CRUD Form components.\n\n```php\npublic function onCreate(array $data)\n{\n    Client::create($data);\n\n    $this-\u003eredirectRoute('clients.index');\n}\n\npublic function onUpdate(array $data)\n{\n    $this-\u003eclient-\u003eupdate($data);\n\n    $this-\u003eredirectRoute('clients.edit', $this-\u003eclient);\n}\n\npublic function onDelete()\n{\n    $this-\u003eclient-\u003edelete();\n\n    $this-\u003eredirectRoute('clients.index');\n}\n```\n\n## Contributing\n\nYou're more than welcome to submit a pull request, or if you're not feeling up to it - create an issue so someone else can pick it up.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fandreaselia%2Flaravel-cruddy","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fandreaselia%2Flaravel-cruddy","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fandreaselia%2Flaravel-cruddy/lists"}