{"id":50349401,"url":"https://github.com/labrodev/contactable","last_synced_at":"2026-05-29T20:30:22.704Z","repository":{"id":344202936,"uuid":"1180817554","full_name":"labrodev/contactable","owner":"labrodev","description":"A configurable Livewire contact form for Laravel with optional model persistence and pluggable notify channels (mail, log, webhook).","archived":false,"fork":false,"pushed_at":"2026-03-13T13:07:33.000Z","size":50,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-03-14T03:29:58.003Z","etag":null,"topics":["labrodev","laravel","laravel-framework","laravel-library","laravel-package","laravel12x","livewire","php-library","php8","web"],"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/labrodev.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE.md","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,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-03-13T12:52:03.000Z","updated_at":"2026-03-13T13:42:20.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/labrodev/contactable","commit_stats":null,"previous_names":["labrodev/contactable"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/labrodev/contactable","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/labrodev%2Fcontactable","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/labrodev%2Fcontactable/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/labrodev%2Fcontactable/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/labrodev%2Fcontactable/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/labrodev","download_url":"https://codeload.github.com/labrodev/contactable/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/labrodev%2Fcontactable/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33670211,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-05-29T02:00:06.066Z","response_time":107,"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":["labrodev","laravel","laravel-framework","laravel-library","laravel-package","laravel12x","livewire","php-library","php8","web"],"created_at":"2026-05-29T20:30:21.996Z","updated_at":"2026-05-29T20:30:22.677Z","avatar_url":"https://github.com/labrodev.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Labrodev Contactable\n\nA configurable Livewire contact form for Laravel with optional model persistence and pluggable notify channels (mail, log, webhook).\n\n## Requirements\n\n- PHP 8.2+\n- Laravel 12+\n- Livewire 4+\n\n## Installation\n\nInstall via Composer:\n\n```bash\ncomposer require labrodev/contactable\n```\n\nThen run `composer update labrodev/contactable`.\n\n## Configuration\n\nPublish the config file:\n\n```bash\nphp artisan vendor:publish --tag=contactable-config\n```\n\nEdit `config/contactable.php`:\n\n| Key | Description |\n|-----|-------------|\n| **fields** | Array of field definitions: `key`, `type`, `label`, `placeholder`, `rules`, `messages`. Use translation keys (e.g. `contactable::fields.name.label`) or your own keys; the view passes them through `__()` at render time. |\n| **model** | Optional Eloquent model FQCN to store submissions (e.g. `App\\Models\\ContactRequest`). Set to `null` to skip persistence. |\n| **notify** | Channel (`mail`, `log`, or `webhook`) and channel-specific options (mail to address, webhook URL, log path). |\n| **success_message** | Flash message after a successful submit (translation key or literal string). |\n| **submit_button_text** / **submit_loading_text** | Button labels (translation key or literal string). |\n| **redirect_route** | Named route to redirect to after submit (e.g. `'contact'`). Omit or `null` to stay on the current page. |\n\n## Usage\n\nIn your layout, include Livewire scripts and styles (`@livewireScripts`, `@livewireStyles`, or the Livewire stack). Then drop in the form with the Blade component:\n\n```blade\n\u003cx-contactable /\u003e\n```\n\nOr use the Livewire component directly:\n\n```blade\n\u003clivewire:contactable::contactable /\u003e\n```\n\n## View customization\n\nPublish the views to match your design system:\n\n```bash\nphp artisan vendor:publish --tag=contactable-views\n```\n\nEdit:\n\n- `resources/views/vendor/contactable/livewire/contactable.blade.php` – Form markup and styling.\n- `resources/views/vendor/contactable/components/contactable.blade.php` – Wrapper (e.g. card, grid).\n\nPublished views override the package defaults.\n\n## Translations\n\nAll user-facing text (labels, placeholders, validation messages, success message, button text) is translated via Laravel’s `__()` helper at render time. Config holds **translation keys** (or literal strings); the view and component pass them through `__()` so the current locale is used.\n\n### Package lang (default)\n\nThe package ships with English in `resources/lang/en.php` under the `contactable::` namespace. The default config uses keys such as:\n\n- `contactable::fields.name.label`, `contactable::fields.name.placeholder`, `contactable::fields.name.required`, `contactable::fields.name.max`\n- `contactable::fields.email.*`, `contactable::fields.message.*`\n- `contactable::success_message`, `contactable::submit_button_text`, `contactable::submit_loading_text`\n\n### Adding or overriding translations\n\n**Option 1 – Publish and edit package lang**\n\n```bash\nphp artisan vendor:publish --tag=contactable-lang\n```\n\nThis copies the package lang to `lang/vendor/contactable/`. Edit `en.php` or add a new locale (e.g. `ua.php`, `de.php`) with the same structure. Laravel will use the correct file based on `config('app.locale')` (and fallback locale).\n\n**Option 2 – Use your own keys**\n\nIn `config/contactable.php` (after publishing config), set labels, messages, and button text to your own translation keys (e.g. `'label' =\u003e 'contact.form.name'`, `'success_message' =\u003e 'contact.form.success_message'`). The view and component still call `__()` on these values, so your app’s lang files (e.g. `lang/en.json`, `lang/ua.json`) are used. No need to publish the package lang if you rely entirely on your own keys.\n\n## Optional model persistence\n\nIf you set `contactable.model` to an Eloquent model class, the package will create a record on each submission. Your model should have fillable (or guarded) attributes matching the field keys (e.g. `name`, `email`, `message`). Create your own migration for the table; the package does not ship one.\n\n## Notify channels\n\nBuilt-in channels:\n\n- **mail** – Sends an email to `contactable.notify.mail.to` (env: `CONTACTABLE_MAIL_TO` or falls back to `MAIL_FROM_ADDRESS`).\n- **log** – Appends a line to a log file (default `storage/logs/contact-submissions.log`; path configurable).\n- **webhook** – POSTs the submission JSON to `contactable.notify.webhook.url` (env: `CONTACTABLE_WEBHOOK_URL`). Timeout is configurable.\n\n### Custom channels\n\nImplement `Labrodev\\Contactable\\Contracts\\NotifierChannel` (single method: `send(ContactableData $data): void`), then register it in config:\n\n```php\n// config/contactable.php\n'notify' =\u003e [\n    'channel' =\u003e 'postmark',\n    'channels' =\u003e [\n        'postmark' =\u003e \\App\\ContactChannels\\PostmarkChannel::class,\n    ],\n    // ... mail, log, webhook options as needed\n],\n```\n\nYour class is resolved from the container (you can inject dependencies). The package merges your `channels` with the built-in ones, so you can override or add channels (e.g. `postmark`, `telegram`).\n\n## Development\n\nFrom the package root (e.g. after cloning or in a path repo):\n\n```bash\ncomposer install\ncomposer test\ncomposer pint\ncomposer stan\n```\n\n## License\n\nMIT. See [LICENSE.md](LICENSE.md).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flabrodev%2Fcontactable","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flabrodev%2Fcontactable","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flabrodev%2Fcontactable/lists"}