From f9b451ef48057cedf804c32e84130eb827737c3f Mon Sep 17 00:00:00 2001 From: William <54738571+WilliamAAK@users.noreply.github.com> Date: Mon, 14 Apr 2025 22:13:10 +0200 Subject: [PATCH] Docs: update --- README.md | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/README.md b/README.md index a766aef..a85112b 100644 --- a/README.md +++ b/README.md @@ -57,7 +57,7 @@ Route::group('/admin', function () { # Installation -## Composer +### Composer: Composer needs to know where to locate the package. Add the repository to your project by declaring it in the `composer.json` file. ```json @@ -77,7 +77,7 @@ Fetch the package by running composer install -## Manual +### Manual: Its all in a single file; include it in your project like so. @@ -102,29 +102,29 @@ http_response_code(404);

Page not found!

``` -## Access directly +### Access directly: -The simplest way to access your routes, put the file in your favorite folder and run it! +The simplest way to access your routes, put the file in your favorite folder and run it! E.g if you request `http://your.site/yourscript.php/your/route` the route will be automatically converted to `/your/route` -If you request `http://your.site/yourscript.php/your/route` the route will be automatically converted to `/your/route` - -## Rewrite requests +### Rewrite requests: Want to hide that pesky script name (e.g `index.php`) from the URL? -### FrankenPHP +#### FrankenPHP: It is recommended that you use FrankenPHP the modern PHP app server. This behavior is enabled by default. -### NGINX +#### NGINX: With PHP already installed and configured you may add this to the server block of your configuration to make requests that don't match a file on your server to be redirected to `index.php` - location / { - try_files $uri $uri/ /index.php?$query_string; - } +```nginx +location / { + try_files $uri $uri/ /index.php?$query_string; +} +``` -### Apache +#### Apache: Make sure that mod_rewrite is installed on Apache. On a unix system you can just do @@ -132,7 +132,7 @@ Make sure that mod_rewrite is installed on Apache. On a unix system you can just This snippet in your .htaccess will ensure that all requests for files and folders that does not exists will be redirected to `index.php` -``` +```apache RewriteEngine on RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_FILENAME} !-f