{"id":19626190,"url":"https://github.com/komtcho/laravel-switch-domain","last_synced_at":"2026-05-16T03:12:48.077Z","repository":{"id":57008249,"uuid":"175816550","full_name":"komtcho/laravel-switch-domain","owner":"komtcho","description":"Switch between all domains of your project on development mode","archived":false,"fork":false,"pushed_at":"2019-03-15T13:20:26.000Z","size":2,"stargazers_count":0,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-01-09T12:40:06.155Z","etag":null,"topics":["domains","komicho","laravel","mpl","packages","php","switch"],"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/komtcho.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":"2019-03-15T12:30:37.000Z","updated_at":"2019-08-13T12:53:56.000Z","dependencies_parsed_at":"2022-08-21T14:31:30.448Z","dependency_job_id":null,"html_url":"https://github.com/komtcho/laravel-switch-domain","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/komtcho%2Flaravel-switch-domain","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/komtcho%2Flaravel-switch-domain/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/komtcho%2Flaravel-switch-domain/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/komtcho%2Flaravel-switch-domain/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/komtcho","download_url":"https://codeload.github.com/komtcho/laravel-switch-domain/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":240926397,"owners_count":19879737,"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":["domains","komicho","laravel","mpl","packages","php","switch"],"created_at":"2024-11-11T11:45:40.571Z","updated_at":"2026-05-16T03:12:43.037Z","avatar_url":"https://github.com/komtcho.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# komicho\\laravel-switch-domain\nSwitch between all domains of your project on development mode\n\n## Install via composer\n```bash\n$ composer require komicho/laravel-switch-domain dev-master\n```\n---\n## `set_domain` method\n```php\nset_domain('\u003cdomain.dev\u003e');\n```\n## add `KOMICHO_SWITCH_DOMAIN_TO` to .env file\n```env\nKOMICHO_SWITCH_DOMAIN_TO=\u003cdomain.dev\u003e\n```\n\u003e If the value is empty, the domains will work in their default form\n\n## How to use\nuse `set_domain` method on `domain` method .. such as the following example\n```php\n...\n-\u003edomain(set_domain('\u003cdomain.dev\u003e'))\n...\n```\n\n## Full example\nGo to file `app/Providers/RouteServiceProvider.php`.\n\n### web routes\n```php\nprotected function mapWebRoutes()\n{\n    Route::middleware('web')\n            -\u003enamespace($this-\u003enamespace)\n            -\u003edomain(set_domain('domain.dev'))\n            -\u003egroup(base_path('routes/web.php'));\n}\n```\n\n### app routes\n```php\nprotected function mapAppRoutes()\n{\n    Route::middleware('web')\n            -\u003enamespace($this-\u003enamespace)\n            -\u003edomain(set_domain('app.domain.dev')))\n            -\u003egroup(base_path('routes/app.php'));\n}\n```\n\nAccording to rules [MPL](https://medium.com/@komicho/micro-package-logic-mpl-10f22ccc50c1) :)\n\nTHX.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkomtcho%2Flaravel-switch-domain","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkomtcho%2Flaravel-switch-domain","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkomtcho%2Flaravel-switch-domain/lists"}