How to get started

Hi

Over the the past 5-6 years I have always used Laravel, and I really like it it, but… I feel like there is too many features that gets loaded on each request - it’s not a complaint, just a fact - and for some projects a more simple approach is needed so I have just started to explore Slim Framework - my first test is with the the odan skeleton app.

I’m on a. mac, with Laravel Valet, php 8.3 and Odan installation worked and even if it the default page is is only ‘Welcome!’, it feels blitzing fast :slight_smile:

now… I then started to read the documentation

not sure why the dev does not have the the test (phpunit) included, why 2 different environments ?

also, it’s not - yet - 100% clear how to set $_ENV variables - from laravel I’m used to have a .env file.

I use a tool called Tinkerwell

foreach ($_ENV as $key => $value) {
  echo $key . " " . $value;
}

in a Laravel app is gives a lot, but in a Slim… nothing - sure I’m doing something wrong.

In the Odan documentation its say that you can change the $_ENV['APP_ENV'] = 'prod';
Not sure how :slight_smile:

is there some documentation that I need to read first ?

Please be gentle, I’m new and I really want to get started with Slim for some of my more “simple” projects.

Small note: I don’t see Slim Framework as a thing you use for small projects, proto types, I see Slim Framework for projects where you are concerned about performance, and use of resources.

This will solve your problems with env. variables: phpdotenv.

I don’t see Slim Framework as a thing you use for small projects, …

You would be surprised. I do.

And a little disclaimer. Slim is just a frame, skeleton that sticks to PSR recommandations. I does not force you to use anything, instead it allows you to use everything.

Speaking about a speed comparison with Laravel. Try to hook Slim onto Roadrunner. It will blow your mind.

Thank you for the question. It inspired us to ask another question: How can slim replace lumen?