{"id":27154536,"url":"https://github.com/squirrel-forge/composer.laravel.cs","last_synced_at":"2025-06-21T13:38:41.368Z","repository":{"id":286187773,"uuid":"906739657","full_name":"squirrel-forge/composer.laravel.cs","owner":"squirrel-forge","description":"Squirrel-Forge Laravel Core Support","archived":false,"fork":false,"pushed_at":"2025-05-17T20:42:00.000Z","size":35,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-05-17T21:28:49.395Z","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/squirrel-forge.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"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}},"created_at":"2024-12-21T19:02:02.000Z","updated_at":"2025-05-17T20:42:03.000Z","dependencies_parsed_at":"2025-04-04T21:26:53.534Z","dependency_job_id":null,"html_url":"https://github.com/squirrel-forge/composer.laravel.cs","commit_stats":null,"previous_names":["squirrel-forge/composer.laravel.cs"],"tags_count":8,"template":false,"template_full_name":null,"purl":"pkg:github/squirrel-forge/composer.laravel.cs","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/squirrel-forge%2Fcomposer.laravel.cs","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/squirrel-forge%2Fcomposer.laravel.cs/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/squirrel-forge%2Fcomposer.laravel.cs/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/squirrel-forge%2Fcomposer.laravel.cs/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/squirrel-forge","download_url":"https://codeload.github.com/squirrel-forge/composer.laravel.cs/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/squirrel-forge%2Fcomposer.laravel.cs/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":261130717,"owners_count":23114025,"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":"2025-04-08T17:36:27.347Z","updated_at":"2025-06-21T13:38:36.357Z","avatar_url":"https://github.com/squirrel-forge.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# composer.laravel.cs\n## Squirrel-Forge Laravel Core Support\n\n### Table of Contents\n\n - [Module information](#module-information)\n   - [Publishing the config](#publishing-the-config)\n   - [Example dotenv values](#example-dotenv-values)\n - [Middleware configuration](#middleware-configuration)\n   - [Dynamic debug](#dynamic-debug)\n   - [Response headers](#response-headers)\n - [Nested folder routing](#nested-folder-routing)\n - [Linking the public directory](#linking-the-public-directory)\n   - [Moving the public directory](#moving-the-public-directory)\n - [Directory locator](#directory-locator)\n\n## Module information\n\nComposer module: **squirrel-forge/lara-cs**\n\nComposer repository entry:\n```json\n{\n    \"type\": \"vcs\",\n    \"url\": \"git@github.com:squirrel-forge/composer.laravel.cs.git\",\n    \"no-api\": true\n}\n```\n\n### Publishing the config\n\n```shell\nphp artisan vendor:publish --tag=sqf-cs\n```\n\n### Example dotenv values\n\nExample dotenv configuration, full list of values:\n\n```dotenv\nSQF_CS_USE=ip,range,keypass\nSQF_CS_ENV=X-CLIENT-IP,REMOTE_ADDR\nSQF_CS_IPS=000.000.000.000,0000:0000:0000:0000::0000:0000\nSQF_CS_RANGES=000.000.000.00/00,0000:00:0000:0:0:0:0:0/00\nSQF_CS_KEY=cxxa80quced65jg817xdxoalhhyn0blk\nSQF_CS_PASS=g2czb0w289zl9xiom6kcy1nc0bbyfiao\nSQF_CS_LIFETIME=Y-m-d-H\nSQF_CS_LIMIT=60\nSQF_CS_LOG=true\nSQF_CS_CSP=\"default-src 'self'; script-src 'self' 'unsafe-inline'\"\n```\n\n## Middleware configuration\n\nCheck the [configuration](resources/config/config.php) for detailed option descriptions.\n\n### Dynamic debug\n\n[Middleware](src/Http/Middleware/DynamicDebug.php) that allows for runtime debug mode activation.\n\n### Response headers\n\n[Middleware](src/Http/Middleware/ResponseHeaders.php) that sets global security headers for every response.\n\n## Nested folder routing\n\nIf your laravel runs in a domain root, but is requested via cdn url rewrite inside a nested path,\nThen follow these instructions to ensure all requests arrive where they are supposed to.\n\nPrefix your routes with the nested path:\n\n```php\nRoute::group(['prefix' =\u003e '/prefixed/path/'], function () {\n    // ... prefixed routes\n});\n```\n\nSet your asset path/url in your *.env* file:\n\n```dotenv\nASSET_URL=/prefixed/path/\n```\n\nTo allow all your public assets to be accessible even when requested from a virtual subdirectory,\nadd following rules to your htaccess after the authorization header and before the trailing slash redirect.\n\n```shell\n# Rewrite routed asset paths\nRewriteRule ^/prefixed/path/css/(.*)$ css/$2 [NC,QSA,L]\nRewriteRule ^/prefixed/path/img/(.*)$ img/$2 [NC,QSA,L]\nRewriteRule ^/prefixed/path/js/(.*)$ js/$2 [NC,QSA,L]\nRewriteRule ^/prefixed/path/favicon.ico$ favicon.ico [NC,QSA,L]\nRewriteRule ^/prefixed/path/robots.txt$ robots.txt [NC,QSA,L]\n```\n\nOr the recommended generic variant, which allows for dynamic prefixes:\n\n```shell\n# Rewrite routed asset paths\nRewriteRule ^(.*)css/(.*)$ css/$2 [NC,QSA,L]\nRewriteRule ^(.*)img/(.*)$ img/$2 [NC,QSA,L]\nRewriteRule ^(.*)js/(.*)$ js/$2 [NC,QSA,L]\nRewriteRule ^(.*)favicon.ico$ favicon.ico [NC,QSA,L]\nRewriteRule ^(.*)robots.txt$ robots.txt [NC,QSA,L]\n```\n\n## Linking the public directory\n\nTo copy or symlink your public directory to a new location, run the *sqfcs:mvpub* command.\nNote that running this command from the appropriate user/context will prevent permission issues.\n\nThe *target* can be relative to laravel root or system absolute.\nThe *--cp* option defines, if and which files are copied instead of being linked.\nThe option respects only file and folder names nested directly in the public dir,\nthough folders will be copied recursively.\n\n```shell\nphp artisan sqfcs:mvpub {target} {--cp=all|filename,dirname,...}\n```\n\nAny *.php files that are copied and not linked, will have \"../\" replaced with the new relative path to the laravel root.\n\n### Moving the public directory\n\nIf you must **move/copy** the public directory and *not link* it to another location,\nin your Kernels, set following code to let laravel know of the move:\n\n```php\nuse function SquirrelForge\\Laravel\\CoreSupport\\joinAndResolvePaths;\n/**\n * Create a new HTTP kernel instance.\n *\n * @param  \\Illuminate\\Contracts\\Foundation\\Application  $app\n * @param  \\Illuminate\\Routing\\Router  $router\n * @return void\n */\npublic function __construct(Application $app, Router $router)\n{\n    $app-\u003eusePublicPath(joinAndResolvePaths(base_path(), '../public/'));\n    parent::__construct($app, $router);\n}\n```\n\n```php\nuse function SquirrelForge\\Laravel\\CoreSupport\\joinAndResolvePaths;\n/**\n * Create a new console kernel instance.\n *\n * @param  \\Illuminate\\Contracts\\Foundation\\Application  $app\n * @param  \\Illuminate\\Contracts\\Events\\Dispatcher  $events\n * @return void\n */\npublic function __construct(Application $app, Dispatcher $events)\n{\n    $app-\u003eusePublicPath(joinAndResolvePaths(base_path(), '../public/'));\n    parent::__construct($app, $events);\n}\n```\n\n## Directory locator\n\nIf you wish to use the directory locator service, you need\nto implement following code in your kernel constructors,\nto allow for setting the directories before laravel uses them.\n\n```php\nuse SquirrelForge\\Laravel\\CoreSupport\\Service as SqfCs;\n/**\n * Create a new HTTP kernel instance.\n *\n * @param  \\Illuminate\\Contracts\\Foundation\\Application  $app\n * @param  \\Illuminate\\Routing\\Router  $router\n * @return void\n */\npublic function __construct(Application $app, Router $router)\n{\n    SqfCs::locateEnvDir('env', $app);\n    SqfCs::locateStorageDir('cache', $app);\n    parent::__construct($app, $router);\n}\n```\n\n```php\nuse SquirrelForge\\Laravel\\CoreSupport\\Service as SqfCs;\n/**\n * Create a new console kernel instance.\n *\n * @param  \\Illuminate\\Contracts\\Foundation\\Application  $app\n * @param  \\Illuminate\\Contracts\\Events\\Dispatcher  $events\n * @return void\n */\npublic function __construct(Application $app, Dispatcher $events)\n{\n    SqfCs::locateEnvDir('env', $app);\n    SqfCs::locateStorageDir('cache', $app);\n    parent::__construct($app, $events);\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsquirrel-forge%2Fcomposer.laravel.cs","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsquirrel-forge%2Fcomposer.laravel.cs","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsquirrel-forge%2Fcomposer.laravel.cs/lists"}