composer install after cloning.
app/Routes.php and use the Router facade:
Router::get('hello/{name}', 'Hello@greet');
Router::post('contact', 'Contact@send');
Router::resource('posts');
Router::group():
Router::group(['prefix' => 'admin'], function () {
Router::get('dashboard', 'Admin@dashboard');
Router::get('users', 'Admin@users');
});
Action suffix convention — indexAction, storeAction, etc. This prevents conflicts with PHP internal methods. The dispatcher automatically appends Action if the bare method name is not found, so both index and indexAction work.
app/Config/Storage.php with the STORAGE_DISKS and STORAGE_DEFAULT constants. Then call Storage::configure() in your front controller. See the File Upload docs for examples.
s3 disk to your STORAGE_DISKS config with driver => 's3' plus your key, secret, region, and bucket. Then use Storage::disk('s3') to interact with it. Requires PHP 8.4+.
Content-Type header. See the File Upload docs for an example.
public/index.php. For Apache, the public/.htaccess file handles this. For nginx, add:
location / {
try_files $uri $uri/ /index.php?$query_string;
}
Also verify that mod_rewrite is enabled.
public/index.php:
ini_set('display_errors', 1);
error_reporting(E_ALL);
Common causes: missing vendor directory (run composer install), PHP version too low, or a missing config file.
session_start() is called in your front controller before any output. The framework's Session::init() handles this. Also check that app/storage/framework/sessions is writable by the web server.
Simply PHP ships with two error presentation modes:
SHOW_ERRORS=true and logs to Monolog when SHOW_ERRORS=false.Set the handler via the ERROR_HANDLER environment variable in .env:
ERROR_HANDLER=whoops # Pretty error pages (default)
ERROR_HANDLER=simply # Framework's built-in handler
To hide errors in production, set SHOW_ERRORS=false in your .env (errors will still be logged to simply/logs/):
SHOW_ERRORS=false