{"id":21216888,"url":"https://github.com/lablnet/php-site","last_synced_at":"2025-07-09T01:33:46.702Z","repository":{"id":57010532,"uuid":"128770415","full_name":"lablnet/PHP-Site","owner":"lablnet","description":"This class can get URLs related with the current request site.","archived":false,"fork":false,"pushed_at":"2020-02-23T09:54:31.000Z","size":12,"stargazers_count":4,"open_issues_count":0,"forks_count":2,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-05T13:11:27.562Z","etag":null,"topics":["class","free","manapulation","php","site"],"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/lablnet.png","metadata":{"files":{"readme":"Readme.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-04-09T12:46:18.000Z","updated_at":"2023-06-18T14:02:04.000Z","dependencies_parsed_at":"2022-08-21T15:10:24.638Z","dependency_job_id":null,"html_url":"https://github.com/lablnet/PHP-Site","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/lablnet/PHP-Site","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lablnet%2FPHP-Site","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lablnet%2FPHP-Site/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lablnet%2FPHP-Site/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lablnet%2FPHP-Site/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/lablnet","download_url":"https://codeload.github.com/lablnet/PHP-Site/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lablnet%2FPHP-Site/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":264375618,"owners_count":23598415,"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":["class","free","manapulation","php","site"],"created_at":"2024-11-20T21:56:08.425Z","updated_at":"2025-07-09T01:33:46.662Z","avatar_url":"https://github.com/lablnet.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"\n# PHP Site\nThis class can get URLs related with the current request site.\n\n## Requirement\n1. PHP 7 (7.3 Recommanded).\n2. Composer.\n\n## Insallation\nInstalling this package is very simple, first ensure you have the right PHP version and composer installed then in your terminal/(command prompt) run:\n``` composer require lablnet/site```\n\n## Feature\n- Base Site URL\n- Current page URL\n- Redirect to other page\n- Goto previous page\n- Generate salts.\n\n## Example\n```php\n\u003c?php\n\nuse Lablnet\\Site;\n\nrequire_once '../vendor/autoload.php';\n\necho 'site url: ';\n//for site url\necho Site::SiteUrl();\n\necho '\u003cbr\u003e Random salts: ';\n\n//for slug,random string\necho Site::Salts(10);\n\n//for redirect\n//Site::Redirect();\n```\n\n## Methods\n\n- `siteUrl()` Get the site url with current page\n- `siteBaseUrl()` Get the site base url\n- `crrentPage()` Get the current\n- `getBase()` Get the domain name\n- `getUri()`  Get the URI\n- `redirect($path)` Redirect to page, `$path` optional, if \t`$path` is not specify then it will redirect to base url of site, this function also support `prev` as `path` so it will redirect page to previous.\n- `segmentUrl()` Get URL part by `/`\n- `getFirstSegment($segments)` Get first segment of URL, `$segments` Required, segments return by `segmentUrl()`\n- `getLastSegment($segments)` Get last segment of URL  `$segments` Required, segments return by `segmentUrl()`\n- `salts(int $length, $special = false)` Generate the salt, `$length` length of salt, `$special` Either include special chars or not.\n\n\n## Contributions  \nThere is still a lot of work to do, so feel free to contribute to open `PR`  \n  \n## License  \nMIT  \n  \n## Support  \nDonate coffee?  \nhere is the bitcoin address  \n[![Balance](https://img.balancebadge.io/btc/37x6PA4qtPu2fQnYdW5U7jztYhbchASpBV.svg)](https://img.balancebadge.io/btc/37x6PA4qtPu2fQnYdW5U7jztYhbchASpBV.svg)\n\n   ```37x6PA4qtPu2fQnYdW5U7jztYhbchASpBV```  \n  \nThanks you so much.\n\n## Disclaimer\n**I don't Accept any responsibility for any illegal usage**","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flablnet%2Fphp-site","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flablnet%2Fphp-site","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flablnet%2Fphp-site/lists"}