Hey everyone,
I’m pretty new to Slim and just started working on a project using Slim Framework. I’m running into an issue and could really use some help from the community.
I’m getting the following error:
Class 'Slim\Slim' not found
When I was searching about this, I came across to these resources/articles Fatal error: Class 'Slim\App' not found Salesforce Journey Builder php - Class 'Slim\Slim' not found with composer - Stack Overflow and as per them I’ve double-checked my code and everything seems fine to me, but obviously, I’m missing something. Here’s a bit more context:
- I installed Slim via Composer with the following command:
composer require slim/slim
- I included the autoload file like this:
require 'vendor/autoload.php';
Here is a snippet of my code:
<?php
require 'vendor/autoload.php';
$app = new Slim\Slim();
$app->get('/', function () {
echo 'Hello, world!';
});
$app->run();
I’m not sure what I’m doing wrong. Any ideas or suggestions would be greatly appreciated! Thanks in advance!
Best Regards,